add_relationships
Batch-add relationships to the active ArchiMate model in one call, with optional rollback on error to restore previous state.
Instructions
Add multiple relationships to the active model in one call.
Each relationship item supports the same fields as `add_relationship`.
Short and long field names are both accepted (`type` or
`relationship_type`, `source` or `source_id`, `target` or
`target_id`, `id` or `relationship_id`).
IDs are unique across the **entire active model**, not per call,
per batch, or per concept type. Splitting a build across several
batches does not give each batch its own id space, so namespace
generated ids (`bp-`, `ac-`, `tech-`) rather than restarting the
same naming pattern in each one.
Relationship item shape:
```
{
"id": "id-uses", # optional stable ref
"type": "Serving", # required (alias: relationship_type)
"source": "id-customer", # required (alias: source_id)
"target": "id-portal", # required (alias: target_id)
"name": "uses", # optional
"description": "...", # optional
"properties": {"k": "v"}, # optional
"access_type": "Read", # for Access only
"influence_strength": "+" # for Influence only
}
```
Args:
relationships: List of relationship item objects.
rollback_on_error: When true (default), restore the previous
model state if any item fails.
Returns:
Success envelope with `data.relationships` (list of
`RelationshipDetail`), `data.count`, and
`data.rollback_on_error`.
Errors:
`InvalidRelationshipTypeError`, `ElementNotFoundError`,
`ModelNotFoundError`, `ModelOperationError` for the first
failing item.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relationships | Yes | ||
| rollback_on_error | No | ||
| semantic_validation | No | warn |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||