Examples
Let us imagine that we have two components C1
, C2
and a single reference R1
between them. In other words, C1
is the source of R1
and C2
is the target of R1
.
Type |
Name |
oid |
component |
C1 |
c253c98231776d0c8a54879e |
component |
C2 |
d893c982317afd0c8a54875f |
Type |
Name |
oid |
source |
target |
reference |
R1 |
91ab09087115f76e365134c5 |
c253c98231776d0c8a54879e |
d893c982317afd0c8a54875f |
We want to create a new component C3
and set it as the target
of the reference R1
. We want to update the name of the component C1
to have the name C1_updated
and we should delete the existing target component C2
. After the update we want the state to look like this:
Type |
Name |
oid |
component |
C1_updated |
c253c98231776d0c8a54879e |
component |
C3 |
<new oid> |
Type |
Name |
oid |
source |
target |
reference |
R1 |
91ab09087115f76e365134c5 |
c253c98231776d0c8a54879e |
<new oid> |
{
"components": {
"create": [
{
"batchId": "my_C3_component",
"body": {
"rootWorkspace": "f2c84727cca064bc0080d0fe",
"typeId": "p1024822409134",
"name": "C3"
}
}
],
"update": [
{
"id": "c253c98231776d0c8a54879e",
"ifVersionMatch": "latest",
"body": {
"name": "C1_updated"
}
}
],
"delete": [
{
"id": "d893c982317afd0c8a54875f"
}
]
},
"references": {
"update": [
{
"id": "91ab09087115f76e365134c5",
"ifVersionMatch": "latest",
"body": {
"target": "my_C3_component"
}
}
]
}
}