EPCIS is a traceability event messaging standard that enables supply chain visibility through sharing event data using a common language across, between and within enterprises.
However, this standard is quite openended and it may not be obvious for business to understand and operate on top of what EPCIS provide with respect to event compliance.
Event profile concept and openepcis-event-sentry framework or SDK so to say comes handy to define event profile, custom validation rules and checking whether event conforms to the rules mapped to specific profile.
What is an event profile?
Event profile is derived from event attributes representing the unique nature of the event which is business specific and can’t be represented as EPCIS standard vocabulary.
For example, fishing, farming, and slaughtering are the event profiles derived from visibility of event type ObjectEvent containing specific information about products in their ilmd data.
Open your terminal and execute the following command
npm install openepcis-event-sentry
This will download and install the library into your project's node_modules directory.
If you prefer to use a CDN, include the library directly in your HTML file using a script tag:
<script src="https://unpkg.com/openepcis-event-sentry@latest/dist/openepcis-event-sentry.browser.js"></script>
The following sections provides with sample usages of various features of SDK
Event profile is a combination of many rules. For example, a business can consider an ObjectEvent valid only when it meets the below criteria.
JSON Schema is used to come up with technical representation of the above rules which can later be used by frameworks for validation purpose. Here is the JSON Schema of above rules.
Learn more about JSON schema from here.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"@context": {
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9]+$": {
"type": "string",
"const": "http://ns.example.com/epcis/"
}
},
"additionalProperties": true
}
]
},
"minItems": 1
},
"type": {
"type": "string",
"enum": [
"ObjectEvent"
]
},
"action": {
"type": "string"
},
"bizStep": {
"type": "string"
},
"epcList": {
"type": "array",
"items": {
"type": "string",
"pattern": "/00/"
},
"minItems": 1,
"uniqueItems": true
},
"example:workingShift": {
"type": "string",
"pattern": "^[0-9]+$"
}
},
"required": [
"epcList",
"type",
"bizStep",
"@context",
"example:workingShift"
],
"if": {
"properties": {
"bizStep": {
"const": "shipping"
}
}
},
"then": {
"properties": {
"bizLocation": {
"maxProperties": 0
}
}
},
"additionalProperties": true
}
]
}
TBD
We welcome your contributions to openepcis-event-sentry! Here are some ways you can get involved: