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

EPCIS Aggregation Add

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

EPCIS Aggregation Event (add)

This page describes the XML to JSON mappings for an add Aggregation Event.

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

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

  "eventID" : "baseExtension/eventID",
  "parentID": "parentID",
   // Context Node: extracted from parentID, if parentID is present and is LGTIN/SGTIN
   parentGTIN: {
     "",
     ...
  },
  "eventTime" : "eventTime",
  "generationInfo" : {
    "isConnectorGenerated" : "true | false",
    "generatedFromEventID" : ""
  },
  "recordTime" : "",
  "eventTimeZoneOffset": "eventTimeZoneOffset",
  // Context Node: epcList
  "childEPCs" : [
    "epc": "epc",
    ...
  ],
  // Context Node: extracted from the childEPCs and childQuantityList EPCIS fields.
    "childGTINs": [
        "",
        ...
    ],
  // Context Node: extension/childQuantityList/quantityElement
  "childQuantityList" : [
    {
      "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)
<epcis:EPCISDocument
    xmlns:epcis="urn:epcglobal:epcis:xsd:1"
    schemaVersion="1.1" creationDate="2015-04-14T09:46:05.724-04:00">
  <EPCISBody>
    <EventList>
      <AggregationEvent>
	<eventTime>2015-03-15T10:00:00.000+01:00</eventTime>
	<eventTimeZoneOffset>+01:00</eventTimeZoneOffset>
	<baseExtension>
	  <eventID>xyz</eventID>
	</baseExtension>
	<parentID>urn:epc:id:sscc:string.string</parentID>
	<childEPCs />
	<action>ADD</action>
	<bizStep>urn:epcglobal:cbv:bizstep:packing</bizStep>
	<disposition>urn:epcglobal:cbv:disp:in_progress</disposition>
	<readPoint>
	  <id>urn:epc:id:sgln:string.string</id>
	</readPoint>
	<bizLocation>
	  <id>urn:epc:id:sgln:string.starting</id>
	</bizLocation>
	  <bizTransactionList>
	    <bizTransaction type="urn:epcglobal:cbv:btt:po">urn:epcglobal:cbv:bt:string:string</bizTransaction>
	    <bizTransaction type="urn:epcglobal:cbv:btt:desadv">urn:epcglobal:cbv:bt:string:string</bizTransaction>
	  </bizTransactionList>
	  <extension>
	    <childQuantityList>
	      <quantityElement>
                <epcClass>urn:epc:class:lgtin:string.string</epcClass>
                <quantity>10</quantity>
                <uom>CS</uom>
	      </quantityElement>
	    </childQuantityList>
	    <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>
 	  </extension>
      </AggregationEvent>
    </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:aggregation:security_disabled:default:default:string=="
}

This is the generated JSON:

{
    "eventTime": "2015-03-15T10:00:00.000+01:00",
    "eventTimeZoneOffset": "+01:00",
    "eventID": "xyz",
    "parentID": "urn:epc:id:sscc:string.string",
    "childEPCs": [],
    "childGTINs": [
        "string"
    ],
    "action": "ADD",
    "bizStep": "urn:epcglobal:cbv:bizstep:packing",
    "disposition": "urn:epcglobal:cbv:disp:in_progress",
    "readPoint": "urn:epc:id:sgln:string.string.string",
    "bizLocation": "urn:epc:id:sgln:string.string.integer",
    "bizTransactionList": [
        {
            "bizTransaction": "urn:epcglobal:cbv:bt:string:string ",
            "type": "urn:epcglobal:cbv:btt:po"
        },
        {
            "bizTransaction": "urn:epcglobal:cbv:bt:string:string ",
            "type": "urn:epcglobal:cbv:btt:desadv"
        }
    ],
    "childQuantityList": [
        {
            "epcClass": "urn:epc:class:lgtin:string.string",
            "quantity": "10",
            "quantity_uom": "CS"
        }
    ],
    "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": [
        "string.string"
    ],
    "flatGTINList": [
        "string"
    ]
}
}
Clone this wiki locally