-
Notifications
You must be signed in to change notification settings - Fork 34
EPCIS Transformation
This page describes the XML to JSON mappings for a transformation (Transformation Event).
Note: ILMD (Instance/Lot Master Data) also generates (layer: 'object', label: 'lotILMD')
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": "transformation",
"data":
{
"eventID" : "baseExtension/eventID",
"eventTime" : "eventTime",
"generationInfo" : {
"isConnectorGenerated" : "true | false",
"generatedFromEventID" : ""
},
"recordTime" : "",
"eventTimeZoneOffset": "eventTimeZoneOffset",
// Context Node: epcList
"inputEpcList" : [
"epc": "epc",
...
],
// Context Node: inputQuantityList/quantityElement
"inputQuantityList" : [
{
"epcClass" : "epcClass",
"quantity" : "quantity",
"uom" : "uom",
},
...
],
"inputGTINList": [
""
],
// Context Node: outputQuantityList/quantityElement
"outputQuantityList" : [
{
"epcClass" : "epcClass",
"quantity" : "quantity",
"uom" : "uom",
},
...
],
"outputGTINList": [
""
],
// 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"
},
...
]
}
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:
- StandardBusinessDocumentHeader.Sender.ContactInformation (all sub-elements)
- StandardBusinessDocumentHeader.Receiver.ContactInformation (all sub-elements)
<?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>
<extension>
<TransformationEvent>
<eventTime>2015-03-15T00:00:00.000-04:00</eventTime>
<eventTimeZoneOffset>-04:00</eventTimeZoneOffset>
<baseExtension>
<eventID>xyz</eventID>
</baseExtension>
<inputEPCList />
<inputQuantityList>
<quantityElement>
<epcClass>urn:epc:class:lgtin:string.string.string</epcClass>
<quantity>300.0</quantity>
<uom>KGM</uom>
</quantityElement>
</inputQuantityList>
<outputQuantityList>
<quantityElement>
<epcClass>urn:epc:class:lgtin:string.string.string</epcClass>
<quantity>100.0</quantity>
<uom>KGM</uom>
</quantityElement>
</outputQuantityList>
<bizStep>urn:epcglobal:cbv:bizstep:commissioning</bizStep>
<disposition>urn:epcglobal:cbv:disp:active</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:prodorder">urn:epcglobal:cbv:bt:string:string
</bizTransaction>
</bizTransactionList>
<extension>
<ilmd>
<cbvmda:itemExpirationDate>2015-03-15</cbvmda:itemExpirationDate>
<cbvmda:bestBeforeDate>2015-03-15</cbvmda:bestBeforeDate >
<cbvmda:sellByDate>2015-03-15</cbvmda:sellByDate>
</ilmd>
<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>
</TransformationEvent>
</extension>
</EventList>
</EPCISBody></epcis:EPCISDocument>
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:transformation:security_disabled:default:default:dXJuOmVwYzppZDpzZ2xuOjA2MTQxNDEuMDAwMDEuMA=="
}
This is the generated JSON:
{
"eventTime": "2015-03-15T00:00:00.000-04:00",
"eventTimeZoneOffset": "-04:00",
"eventID": "xyz",
"inputEPCList": [],
"inputQuantityList": [
{
"epcClass": "urn:epc:class:lgtin:string.string.string",
"quantity": "300.0",
"quantity_uom": "KGM"
}
],
"inputGTINList": [
"0614141.02222"
],
"outputQuantityList": [
{
"epcClass": "urn:epc:class:lgtin:string.string.string",
"quantity": "100.0",
"quantity_uom": "KGM"
}
],
"outputGTINList": [
"0614141.04444"
],
"bizStep": "urn:epåçcglobal:cbv:bizstep:commissioning",
"disposition": "urn:epcglobal:cbv:disp:active",
"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:prodorder"
}
],
"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.string",
"string.string.string"
],
"flatGTINList": [
"string.string",
"string.string"
]
}
}
WELCOME!
Modules
Membership
Languages
Browsers
ONBOARDING
Onboarding Steps
Data Requirements
Data Types
Supplier Data
Payload Data
Insights Data
HOW-TO
Join by Invitation
Log in as New User
Authenticate Human Users
Authenticate System Users
Java Sample
Typescript Sample
IIB Sample
Assign User Roles
Upload Data
Automate Data Upload
Convert Spreadsheets
Convert Data
Whitelist Custom URLs
APIs-Swagger
Connector API
Documents API
Converter API
Trace API
Insights API
APIs-Usage
APIs
Insights API
Insights API Usage
Trace API
Connector API Errors
API Error Codes
REFERENCE
GS1
GS1 Identifier Reuse
Authentication
Identifiers
Message Codes
Cryptographic
Signatures
Signature Header
Access Control
Firewall Settings
XML to JSON
EPCIS Aggregation Add
EPCIS Aggregation Delete
EPCIS Object Add
EPCIS Object Delete
EPCIS Object Observed
EPCIS Transformation
Purchase Order
Despatch Advice
Receiving Advice
Master Data Item
Master Data Facility
Standard Business
Document Header