Batch Ids
A Batch Id (batchId
) is an optional user provided string that can be associated with a component or reference being created. The batch Id serves the following purposes:
-
Allow for a component being created to be referenced within the same request.
- A component may use the
batchId
of another component in the request as the value for theparent
field. - A reference may use the
batchId
of a component in the request as the value for thesource
field. - A reference may use the
batchId
of a component in the request as the value for thetarget
field.
- A component may use the
-
In the response every provided batch Id will be associated with a generated OID. As the response of a batch does not guarantee any ordering, the
batchId
can be stored on the client side and then used to find the associated created component/reference in the response.
{
"components": {
"create": [
{
"batchId": "C1",
"body": {
"rootWorkspace": "c253c98231776d0c8a54879e",
"typeId": "p1024822409134",
"name": "C1"
}
}
],
"upsert": [
{
"batchId": "C2",
"uniqueBy": ["rootWorkspace", "name"],
"body": {
"rootWorkspace": "c253c98231776d0c8a54879e",
"typeId": "p1024822409134",
"name": "C2"
}
}
]
},
"references": {
"create": [
{
"batchId": "R1",
"body": {
"source": "C1",
"target": "C2",
"type": 2
}
}
]
}
}