I tried implementing the batch operation with content id as given in the blog. The process works fine when only a single item is passed. When more than one items are passed in the payload it throws an error.
The following is the error.
Association cardinality for node Person Involved, association PERSON_INJ_INFO violated.
Person is the item set.
--batch_a80f-2292-a769
Content-Type: multipart/mixed; boundary=changeset
--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary
POST Incidents HTTP/1.1
Content-Id: 1
Content-Type: application/json
Accept: application/json {"IncidentCategory":"001","IncidentDescriptionOfEvents":"test123","IncidentUTCDateTime":"\/Date(1525683009034)\/","EHSLocationUUID":"005056B0-240D-1ED5-BF9A-2D76E9FD7F8A","__metadata":{"type":"EHS_INC_REPORTINCIDENT_SRV.Incident","uri":"/SGD/sap/opu/odata/sap/EHS_INC_REPORTINCIDENT_SRV/Incidents('id-1525683009032-71')"}}
--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary
POST $1/Persons HTTP/1.1
Content-Type: application/json
Content-Id-Ref: 1
Accept: application/json
{ "PersonInvolvedRole":"EHHSS_PR_INJURED_PER", "PersonFullName":"Ricky Pointing" }
--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary
POST $1/Persons HTTP/1.1
Content-Type: application/json
Content-Id-Ref: 1
Accept: application/json
{ "PersonInvolvedRole":"EHHSS_PR_INJURED_PER", "PersonFullName":"Micheal Clarke" }
--changeset--
--batch_a80f-2292-a769--