Hi there,
i have a question regarding batch operation ADD_LINK.
For creation of documents for example workspaces in the A12 Installer we use the CSV import endpoint of installer_bap-server that utilizes the a12 services.
To get the imported documents in relation with existing categories I simply create an ADD_LINK batch request containing between 1-10k ADD_LINK operations.
When doing the request it took a long time until they are processed.
If one of the entries is an duplicate of an existing relationship link the whole batch request is aborted and no relationship link is created from the request.
Is this intended?
From my side of view it would be a great benefit if all requests that could pass will pass and the failing ones will be in the results errors object.
A12 2020.06 | A12 Services 29.0.0 | installer_bap-server-202006.0.0
Answer from Tomas:
Hi Markus,
Batch request handling is transactional this means that is one operation fails all others must be rolled back. This behavior is very important from the client perspective because, the client must know that the request will bring server from one consistent state to another. There is no middle ground. Image that you would like to fix some issues on the server when half of the operations failed and the other half went through. You would have great troubles to define what actually happened and what is the state of the server because many operations are actually dependent on each other.
I would suggest to breaking down your huge request into the smaller batch requests which could contain all information for creation of a link. I.e.:
50 - ADD_DOCUMENT operations
50 - ADD_LINK operations using documents created in 50 ADD_DOCUMENT operations
once this request is successful you know that 50 documents and 50 links have been created and you can move on to another request.
We have a good experience with Postman runner to execute all request in a directory against the server.
For performance improvement please make sure that you are using the following configuration mgm.services.core.useModelGraphCaches=true
Thanks Tomas for super fast clearification 
I totally forgot to set mgm.services.core.useModelGraphCaches=true thanks for reminder.
50 - ADD_DOCUMENT operations
50 - ADD_LINK operations using documents created in 50 ADD_DOCUMENT operations
Alright so I can skip the api/import and just use api/v2/batch for same action.
QUESTION
for creation of relationship links I need the row index of the created documents. Will ADD_DOCUMENT request return the indexes?
Answer from Tomas:
Relationships_Import_Data.json (14.7 KB)
I have attached the batch request which contains ADD_DOCUMENT and ADD_LINKS operations. ADD_LINK refers to the ADD_DOCUMENT operation id to find out about the newly created document id:
{
"id": "addGroup1",
"operation": "ADD_DOCUMENT",
"parameters": {
"document": {
"GeneralInformation": {
"Name": "Group1",
"Description": "Group1"
},
"Group": {
"Repeatability": 24
}
},
"documentModelName": "DomainGroup",
"locale": null
}
},
{
"id": "addRule",
"operation": "ADD_DOCUMENT",
"parameters": {
"document": {
"GeneralInformation": {
"Name": "Rule1",
"Description": "Rule1"
}
},
"documentModelName": "DomainRule",
"locale": null
}
},
{
"id": "addRuleToGroup",
"operation": "ADD_LINK",
"parameters": {
"link": {
"linkDescriptor": {
"relationshipModel": "GroupElement",
"entities": [
{
"role": "parent",
"docRef": "#{#addGroup1.docRef}"
},
{
"role": "child",
"docRef": "#{#addRule.docRef}"
}
]
}
}
}
},
addRuleToGroup operation id creates a link between the document that was created by addGroup1 operation and the document that was created by addRule operation 
to have this option enabled please use the following configuration:
mgm.services.core.batch.spel.resolution.enabled=true
for services versions 30.0.0-alpha.3+
^So i have to upgrade to new service release. but thats ok for my usecase.