Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

EPCIS Object Add

Josh Horton edited this page Feb 21, 2020 · 2 revisions

EPCIS Object add (Commission Event)

This page describes the XML to JSON mappings for an Object add (Commission Event).

Note: An ILMD (Instance/Lot Master Data) also generates (layer: 'object', label: 'lotILMD').

GS1 to JSON mapping

This section shows the GS1 XML to JSON mappings. JSON keys are on the left, and the XPaths to the corresponding tag in GS1 XML are on the right, separated by a colon character (:).

// Context Node: /epcis:EPCISDocument/EPSICBody/EventList/ObjectEvent

{
"assetIdUri": "urn:ibm:provenance:asset:transaction:order:<string>:default:default:<string>",
"organization": "<string>",
"layer": "event",
"label": "commission",
"data":

{
  "eventID" : "baseExtension/eventID",
  "eventTime" : "eventTime",
  "generationInfo" : {
    "isConnectorGenerated" : "true | false",
    "generatedFromEventID" : ""
  },
  "recordTime" : "",
  "eventTimeZoneOffset": "eventTimeZoneOffset",
  // Context Node: epcList
  "epcList" : [
    "epc": "epc",
    ...
  ],
  // Context Node: extension/quantityList/quantityElement
  "quantityList" : [
    {
      "epcClass" : "epcClass",
      "quantity" : "quantity",
      "uom" : "uom",
    },
    ...
  ],
  // Context Node: Flat list of all epcs in event. Union of epcList and quantityList.epcClass.
  "flatEPCList" : [
    ":epcClass",
    ...
  ],
  "flatGTINList" : [
    "",
    ...
  ],
  "action" : "ADD",
  "bizStep" : "bizStep",
  "disposition" : "disposition",
  "readPoint" : "readpoint/id",
  "bizLocation" : "bizLocation/id",
  // Context Node: extension/sourceList
  "sourceList" : [
    {
      "type" : "source/@type",
      "source" : "source"
    },
    ...
  ],
  // Context Node: extension/destinationList
  "destinationList" : [
    {
      "type" : "destination/@type",
      "destination" : "destination",
    },
    ...
  ],
  // Context Node: bizTransactionList
  "bizTransactionList" : [
    {
      "type" : "bizTransaction/@type",
      "bizTransaction" : "bizTransaction"
    },
    ...
  ]
}

Input

The following example shows a valid GS1 XML file for input. The JSON output follows.

Note: The following fields have been removed for GDPR compliance:

  1. StandardBusinessDocumentHeader.Sender.ContactInformation (all sub-elements)
  2. StandardBusinessDocumentHeader.Receiver.ContactInformation (all sub-elements)
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<epcis:EPCISDocument xmlns:epcis="urn:epcglobal:epcis:xsd:1" xmlns:cbvmda="urn:epcglobal:cbv:mda" xmlns:example="http://ns.example.com/epcis" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" creationDate="2005-07-11T11:30:47.0Z" schemaVersion="1.2">

  <EPCISBody>
    <EventList>
      <ObjectEvent>
        <eventTime>2013-06-08T14:58:56.591Z</eventTime>
        <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
        <baseExtension>
        <eventID>1234</eventID>
        </baseExtension>
        <epcList/>
        <action>ADD</action>
        <bizStep>urn:epcglobal:cbv:bizstep:commissioning</bizStep>
        <disposition>urn:epcglobal:cbv:disp:active</disposition>
        <readPoint>
          <id>urn:epc:id:sgln:string.string.integer</id>
        </readPoint>
        <bizLocation>
          <id>urn:epc:id:sgln:string.string.integer</id>
        </bizLocation>
        <extension>
          <quantityList>
            <quantityElement>
              <epcClass>urn:epc:class:lgtin:string.string.string</epcClass>
              <quantity>200</quantity>
              <uom>KGM</uom>
            </quantityElement>
          </quantityList>
          <sourceList>
            <source type="urn:epcglobal:cbv:sdt:owning_party">urn:epc:id:sgln:string.string.integer</source>
          </sourceList>
          <destinationList>
            <destination type="urn:epcglobal:cbv:sdt:owning_party">urn:epc:id:sgln:string.string.integer
            </destination>
          </destinationList>
      <ilmd>
        <cbvmda:itemExpirationDate>2015-03-15</cbvmda:itemExpirationDate>
        <cbvmda:farmList><cbvmda:farmIdentification></cbvmda:farmIdentification></cbvmda:farmList>
        <cbvmda:lot>A123</cbvmda:lot>
      </ilmd>
        </extension>
      </ObjectEvent>
    </EventList>
  </EPCISBody>
</epcis:EPCISDocument>

Output

The following example shows the JSON output from the input GS1 XML file above.

This is the generated URN:

{
  "urn": "urn:ibm:provenance:asset:event:commission:security_disabled:default:default:string"
}

This is the generated JSON:

{
    "eventTime": "2013-06-08T14:58:56.591Z",
    "eventTimeZoneOffset": "+02:00",
    "eventID": "1234",
    "epcList": [
        {}
    ],
    "action": "ADD",
    "bizStep": "urn:epcglobal:cbv:bizstep:commissioning",
    "disposition": "urn:epcglobal:cbv:disp:active",
    "readPoint": "urn:epc:id:sgln:string.string.integer",
    "bizLocation": "urn:epc:id:sgln:string.string.integer",
    "quantityList": [
        {
            "epcClass": "urn:epc:class:lgtin:string.string.string",
            "quantity": "200",
            "uom": "KGM"
        }
    ],
    "sourceList": [
        {
            "source": "urn:epc:id:sgln:string.string.integer",
            "type": "urn:epcglobal:cbv:sdt:owning_party"
        }
    ],
    "destinationList": [
        {
            "destination": "urn:epc:id:sgln:string.string.integer ",
            "type": "urn:epcglobal:cbv:sdt:owning_party"
        }
    ],
    "flatEPCList": [
        "urn:epc:class:lgtin:string.string.string"
    ]
}
Clone this wiki locally