Creating records that are associations of primary records

You can create linked dependent resources for primary records.

About this task

You can add associated dependent records to a primary record. The linked resource determines the association and the associated resource.

Example: Creating a purchase order with two purchase order line items

The following method creates a purchase order resource with two purchase order line item resources. The name of the linked resource is HasPOLineItem.

{
  "spi:action":"Create Draft (triCreateDraft)",
  "spi:triNameTX":"oslcPO",
  "trirldr:HasPOLineItem":
    [
      {
        "spi:action":"Create (triCreate)",
        "spi:triNameTX":"POLineItem1"
      },
      {
        "spi:action":"Create (triCreate)",
        "spi:triNameTX":"POLineItem2"
      }
    ]
}

If the request is processed successfully, the OSLC client receives the following response:

201 Created
Location: http://yourserver/oslc/so/PO/10269
ETag: 1376596202470