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

EPCIS Aggregation Delete

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

EPCIS Aggregation Event (delete)

This page describes the XML to JSON mappings for a delete Aggregation Event.

Generation from Aggregation Event

When the connector determines that an Aggregation Event links to a Disaggregation Event, the connector will generate the Disaggregation Event by copying the fields from the Aggregation Event.

The rules are as follows:

If there are biztransaction with type = "urn:epcglobal:cbv:btt:desadv" (despatch advice), then do the following for each:

  • EventID will be generated for the disaggregation event (via hashing)
  • Set generatedInfo.isGenerated to true and associate back generatedFromEventID to be aggregation eventID
  • "Action": "DELETE"
  • "bizStep": "urn:epcglobal:cbv:bizstep:unpacking"
  • "disposition": "urn:epcglobal:cbv:disp:in_progress"
  • bizLocation should be set equal to the destinationList.destination of the aggregation event
  • All other fields are copied into respective fields if naming matches

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" : "DELETE",
  "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.string</id>
	</readPoint>
	<bizLocation>
	  <id>urn:epc:id:sgln:string.string.integer</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:disaggregation:security_disabled:default:default:string"
}

This is the generated JSON:

{
   {
    "token": "token",
    "type": "asset",
    "id": "urn:ibm:provenance:asset:event:disaggregation:security_disabled:default:default:string",
    "data": {
        "eventTime": "2015-03-15T10:00:00.000+01:00",
        "eventTimeZoneOffset": "+01:00",
        "parentID": "urn:epc:id:sscc:string.string",
        "childEPCs": [],
        "childGTINs": [
            "string"
        ],
        "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"
            }
        ],
        "action": "DELETE",
        "bizStep": "unc:epcglobal:cbv:bizstep:unpacking",
        "disposition": "unc:epcglobal:cbv:disposition:in_progress",
        "flatEPCList": [
            "string.string"
        ],
        "flatGTINList": [
            "string"
        ],
        "generationInfo": {
            "isConnectorGenerated": "true",
            "generatedFromEventId": "urn:epc:id:sscc:string.string"
        },
        "eventID": "string"
    }
}
}
Clone this wiki locally