EPCIS File Format Description
EPCIS File Format Description
Data Import files.
EPCIS data is entered into the TIX installation by importing data files. This section gives a short description of this format and the process of importing it.
XML Format
The XML format of EPCIS data is extensively covered in the EPCIS specification. The following sections will give a short introduction to the EPCIS format but for a complete understanding we refer to
the specification.
Events
The basic element of the EPCIS specification is an event. Each event has fields that describe four basic aspects, namely what, when, where and why. What, concerns the objects or other entities that are the
subject of the event. Typically an EPC (Electronic Product Code). When, is simply the time an event occurred. Where, denotes the location at which an event takes place. This can be for example an ID
representing a warehouse or a factory. Or it can be an ID representing a read point, for instance an RFID scanner. Why, is the business context of the event.
The EPCIS specification defines five different types of events.
- EPCISEvent is a generic base class for all event types.
- ObjectEvent represents an event that happened to one or more entities denoted by EPCs
- AggregationEvent represents an even that happened to one or more entities denoted by EPCs that are physically aggregated together. (physically constrained to be in the same place at the same time, as when cases are aggregated to a pallet).
- QuantityEvent represents an event concerned with a specific quantity of entities sharing a common EPC class, but where the individual identities of the entities are not specified.
- TransactionEvent represents an event in which one or more entities denoted by EPCs become associated or disassociated with one or more identified business transactions.
eventTime
The eventTime in an EPCISEvent does not require a TimeZone but we strongly recommend that one is provided. The TIX will assume that the eventTime without TimeZone is in the configured TIX TimeZone.
The following is an example of an EPCISDocument containing two ObjectEvents
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><epcis:EPCISDocument xmlns:epcis="urn:epcglobal:epcis:xsd:1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" creationDate="2005-07-11T11:30:47.0Z" schemaVersion="1"> <EPCISBody> <EventList> <ObjectEvent> <eventTime>2005-04-03T20:33:31.116-06:00</eventTime> <eventTimeZoneOffset>-06:00</eventTimeZoneOffset> <epcList> <epc>urn:epc:id:sgtin:0614141.107346.2017</epc> </epcList> <action>OBSERVE</action> <bizStep>urn:epcglobal:epcis:bizstep:fmcg:shipped</bizStep> <disposition>urn:epcglobal:epcis:disp:fmcg:unknown</disposition> <readPoint> <id>urn:epc:id:sgln:0614141.07346.1234</id> </readPoint> <bizLocation> <id>urn:epcglobal:fmcg:loc:0614141073467.A23-49</id> </bizLocation> <bizTransactionList> <bizTransaction type="urn:epcglobal:fmcg:btt:po">http://transaction.acme.com/po/12345678</bizTransaction> </bizTransactionList> </ObjectEvent> <ObjectEvent> <eventTime>2005-04-04T20:33:31.116-06:00</eventTime> <eventTimeZoneOffset>-06:00</eventTimeZoneOffset> <epcList> <epc>urn:epc:id:sgtin:0614141.107346.2018</epc> </epcList> <action>OBSERVE</action> <bizStep>urn:epcglobal:epcis:bizstep:fmcg:received</bizStep> <disposition>urn:epcglobal:epcis:disp:fmcg:processing</disposition> <readPoint> <id>urn:epcglobal:fmcg:loc:0614141073467.RP-1529</id> </readPoint> <bizLocation> <id>urn:epcglobal:fmcg:loc:0614141073467.A23-49-shelf1234</id> </bizLocation> <bizTransactionList> <bizTransaction type="urn:epcglobal:fmcg:btt:po">http://transaction.acme.com/po/12345678</bizTransaction> <bizTransaction type="urn:epcglobal:fmcg:btt:asn">http://transaction.acme.com/asn/1152</bizTransaction> </bizTransactionList> </ObjectEvent> </EventList> </EPCISBody></epcis:EPCISDocument>Conversion of EPCIS data to TraceTracker Traceability Data
When EPCIS data is uploaded to a TIX it is stored as is, and the data can be viewed using the available interfaces. However EPCIS events are also converted into the TraceTracker Traceability Data format (ttData for short). One can think of this format as an aggregated view of all the EPCIS events. This makes it especially suitable if one wants to look at the current state of an object since all EPCIS events concerning the same EPC will simply update the properties of the corresponding TradeUnit or Batch in the ttData format.
The default behavior of the conversion is that ObjectEvents with action Add will create a TradeUnit, specifically the default TradeUnit defined in the TRD. While an ObjectEvent with action OBSERVE will update the properties of same TradeUnit. Finally, an ObjectEvent wil action DELETE will remove the TradeUnit. It is however possible to precisely control the conversion using the extensibility mechanism of the EPCIS specification, which we'll explore in the following sections.
Namespaces for EPCIS extensions
All extensions to the EPCIS specification must be bound to a namespace. The following is a list of namespaces used for the elements that control the conversion to ttData format.
- xmlns:ttdata="http://www.tracetracker.com/data" Any extension will be converted to a ttData property, but a property with a specified ttdata namespace can specify a timestamp for that property value using a timestamp attribute.
- xmlns:gtnet="http://www.globaltraceability.net/schema/epcis" This namespace is used by elements that control the conversion. Such as whether an event should be converted into a Batch or TradeUnit, or what kind of transformation it corresponds to. It is also used by elements that specify the amount of a unit parameter transformation.
These namespaces are used in the following sections, but for brevity we only include the prefixes in the examples. Note that according the the EPCIS specification all extension elements must be placed last in the event.
ObjectEvent with action ADD
This event will result in the creation of a Batch or TradeUnit with properties.
Extensions that can be used with this event:
- <ttdata:propertyName>value</ttdata:propertyName> Any element bound to the ttData namespace till result in the creation of a property with the given name and value. Note that there is a size limit to the propertyName of 255 characters.
- <gtnet:entityClass>value</gtnet:entityClass> This elements specifies what entity class should be created. Possible values are 'TradeUnit', 'Batch' or 'Location'. If omitted a TradeUnit will be created.
- <gtnet:trdType>value</gtnet:trdType> Specifies which type of Traceable to create. value must be a type that is defined in the TRD currently being used. If omitted the default type in the TRD is used.
The following is an example of an Event that is converted into a TradeUnit with two properties:
<ObjectEvent> <eventTime>2004-07-03T08:00:00.0Z</eventTime> <eventTimeZoneOffset>+00:00</eventTimeZoneOffset> <epcList> <epc>urn:gtnet:070100000001.gutfresh_1.0001</epc> </epcList> <action>ADD</action> <ttData:Species>Salmon</ttData:Species> <ttData:Treatments>Gutted</ttData:Treatments> <gtnet:entityClass>TradeUnit</gtnet:entityClass> <gtnet:trdType>PackedGuttedFresh</gtnet:trdType></ObjectEvent>
ObjectEvent with action OBSERVE
This event will result in an update of a TradeUnit or Batch. Extensions that can be used with this event:
- <ttdata:propertyName>value</ttdata:propertyName> The property represented will be updated with the given value.
- <gtnet:entityClass>value</gtnet:entityClass> This elements specifies what entity class should be updated. Possible values are 'TradeUnit', 'Batch' or 'Location'. If omitted a TradeUnit will be created.
- <gtnet:alternateId>value</gtnet:alternateId> This element work in consort with receivedId to model an external id.
- <gtnet:receivedId>value</gtnet:receivedId> This element work in consort with alternateId to model an external id.
- <gtnet:party_id>value</gtnet:party_id> This element is used to identify an organization in the Global Traceability Network. This element is required whenever an event models a TradeUnit being sent to or received from another organzation.
- <gtnet:party_id_type>value</gtnet:party_id_type> This element is used to specify what type of id is used in the party_id element. This element must be specifed whenever the party_id element is specifed.
The following is an example of an Event that is converted into a TradeUnit which is sent to another organization:
<ObjectEvent> <eventTime>2001-02-02T13:00:00.0Z</eventTime> <eventTimeZoneOffset>+00:00</eventTimeZoneOffset> <epcList> <epc>ReceivedRM</epc> </epcList> <action>OBSERVE</action> <bizStep>urn:epcglobal:cbv:bizstep:shipping</bizStep> <gtnet:party_id>7080000701438</gtnet:party_id> <gtnet:party_id_type>gln</gtnet:party_id_type></ObjectEvent>
ObjectEvent with action DELETE
This event will result in the removal of a TradeUnit or Batch.
Extensions that can be used with this event:
- <gtnet:entityClass>value</gtnet:entityClass> This elements specifies what entity class should be removed. Possible values are 'TradeUnit', 'Batch' or 'Location'. If omitted 'TradeUnit' will be used.
The following is an example of an Event that results in the removal of a Batch:
<ObjectEvent> <eventTime>2002-02-02T13:00:00.0Z</eventTime> <eventTimeZoneOffset>+02:00</eventTimeZoneOffset> <epcList> <epc>urn:gtnet:070306400001.prod_1.0001</epc> </epcList> <action>DELETE</action> <gtnet:entityClass>Batch</gtnet:entityClass></ObjectEvent>
AggregationEvent with action ADD
This event will be converted into the transformations mix, split, join and enter cluster.
Extensions that can be used with this event:
- <gtnet:transformationType>value</gtnet:transformationType> This element specifes what kind of transformation this event should be converted into. Possible values in the context of this event are: MIX, SPLIT and ENTERCLUSTER.
- <gtnet:amountPerChild>value</gtnet:amountPerChild> This element is used when the transformation type is either mix or split. It is a number and specifies the amout being transformed from one TradeUnit into another.
- <gtnet:amountUnit>value</gtnet:amountUnit> This element specifies the unit of the value in the amountPerChild element.
The following is an example of an Event that results in a mix transformation.
<AggregationEvent> <eventTime>2001-01-02T14:00:00.0Z</eventTime> <eventTimeZoneOffset>+00:00</eventTimeZoneOffset> <parentID>123</parentID> <childEPCs> <epc>Product</epc> </childEPCs> <action>ADD</action> <bizStep>urn:epcglobal:cbv:bizstep:transforming</bizStep> <gtnet:transformationType>MIX</gtnet:transformationType> <gtnet:amountUnit>gram</gtnet:amountUnit> <gtnet:amountPerChild>11</gtnet:amountPerChild></AggregationEvent>
AggregationEvent with action DELETE
This event will be converted into the transformations JOIN, CONVERT and LEAVECLUSTER.
Extensions that can be used with this event:
- <gtnet:transformationType>value</gtnet:transformationType> This element specifes what kind of transformation this event should be converted into. Possible values in the context of this event are: JOIN, CONVERT and LEAVECLUSTER.
The following is an example of an Event that results in a leave cluster transformation.
<AggregationEvent> <eventTime>2001-01-05T19:00:00.0Z</eventTime> <eventTimeZoneOffset>+00:00</eventTimeZoneOffset> <parentID>finished_product</parentID> <childEPCs> <epc>prod_11</epc> </childEPCs> <action>DELETE</action> <bizStep>urn:epcglobal:cbv:bizstep:unpacking</bizStep> <gtnet:transformationType>LEAVECLUSTER</gtnet:transformationType></AggregationEvent>