create_model_from_spec
Create a complete ArchiMate model from a structured JSON spec. Accepts elements, relationships, and views with optional rollback on error.
Instructions
Create a complete ArchiMate model from a structured JSON spec.
The spec is applied transactionally by default. Element, relationship,
and view objects accept either short field names (`type`, `source`,
`target`, `id`, `element`, `relationship`) or the long forms used by
individual tools (`element_type`, `relationship_type`, `source_id`,
`target_id`, `element_id`, `relationship_id`, `view_id`).
Spec shape:
```
{
"name": "Model Name", # required
"elements": [ # optional list
{
"id": "id-customer", # optional stable ref
"name": "Customer", # required
"type": "BusinessActor", # required
"description": "...", # optional
"folder_path": "/Business", # optional
"properties": {"owner": "EA"} # optional
}
],
"relationships": [
{
"id": "id-uses", # optional stable ref
"type": "Serving", # required
"source": "id-customer", # required ref or UUID
"target": "id-portal", # required ref or UUID
"name": "uses", # optional
"description": "...", # optional
"properties": {...}, # optional
"access_type": "Read", # for Access only
"influence_strength": "+" # for Influence only
}
],
"views": [
{
"id": "id-context", # optional stable ref
"name": "Context", # required
"folder_path": "/Views", # optional
"nodes": [ # optional
{"element": "id-customer",
"x": 40, "y": 40, # x/y optional
"width": 160, "height": 80} # width/height optional
],
"connections": [ # optional
{"relationship": "id-uses"}
],
"connect_visible_relationships": true, # optional
"auto_layout": true, # optional
"layout_strategy": "layered_by_type", # optional
"layout_engine": "internal" # optional; or
# "pyarchimate"
}
]
}
```
Args:
spec: Specification object as described above.
rollback_on_error: When true (default), restore the previous
active model on any failure. Set to false to keep partial
results.
Returns:
Success envelope with `data` containing summary IDs of created
model, elements, relationships, and views.
Errors:
`INVALID_SPEC` for missing required keys.
`InvalidElementTypeError`, `InvalidRelationshipTypeError`,
`ElementNotFoundError`, `ModelOperationError` for validation or
creation failures.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | ||
| rollback_on_error | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||