skip to main content
Corticon Server: Data Integration Guide : Advanced EDC Topics : Metadata for Datastore Identity in XML and JSON Payloads
 

Try Corticon Now

Metadata for Datastore Identity in XML and JSON Payloads

When Element attributes have extra information at the Entity Element level, data such as the datastore identity requires special handling as metadata because it is not an attribute in the Vocabulary. It is invalid to declare the datastore identity as an Element, as shown:
<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest decisionServiceName="MyDS">
  <WorkDocuments>
    <TestEntity1 id="TestEntity1_id_1">
      <databaseid>1</databaseid>  this is incorrect  
      <testBoolean xsi:nil="true" />
      <testDate xsi:nil="true" />
      <testDateTime xsi:nil="true" />
      <testDecimal xsi:nil="true" />
      <testInteger xsi:nil="true" />
      <testString xsi:nil="true" />
      <testTime xsi:nil="true" />
    </TestEntity1>
  </WorkDocuments>
</CorticonRequest>

Adding Datastore Identity to an XML Payload

For an XML payload, databaseid is placed inside the Element, as shown:
<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest decisionServiceName="MyDS">
  <WorkDocuments>
    <TestEntity1 databaseid="1" id="TestEntity1_id_1">
      <testBoolean xsi:nil="true" />
      <testDate xsi:nil="true" />
      <testDateTime xsi:nil="true" />
      <testDecimal xsi:nil="true" />
      <testInteger xsi:nil="true" />
      <testString xsi:nil="true" />
      <testTime xsi:nil="true" />
    </TestEntity1>
  </WorkDocuments>
</CorticonRequest>

Adding Datastore Identity to a JSON Payload

In JSON formatting, the #datastore_id is placed in the __metadata section of the Entity, as shown:
{
    "Objects": [{
        "testDate": null,
        "testDecimal": null,
        "testDateTime": null,
        "testString": null,
        "testBoolean": null,
        "testInteger": null,
        "testTime": null,
        "__metadata": {
            "#id": "TestEntity1_id_1",
            "#type": "TestEntity1",
            "#datastore_id": "1"
        }
    }]
}
For more information about datastore identity, see the topic Identity strategies.