### Run Testdata Generator with Podman Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/README.md This command runs the OpenEPCIS Test Data Generator container using Podman. It maps port 8080 and ensures the container is removed upon exit. Requires Podman to be installed. ```bash podman run --rm -t --name testdata-generator -p 8080:8080 ghcr.io/openepcis/testdata-generator:0.9.4 ``` -------------------------------- ### Run Testdata Generator with Java JAR Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/README.md This command executes the OpenEPCIS Test Data Generator application directly using a Java JAR file. It requires Java 17 Runtime Environment or greater to be installed. The JAR file should be downloaded from the GitHub Releases page. ```bash java -jar testdata-generator-quarkus-rest-app-.jar ``` -------------------------------- ### Build Quarkus Native Executable Locally Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/azure-function/README.md Compiles the Quarkus application into a native executable using Maven and a local GraalVM installation. This method requires GraalVM (>=21.0.2) and a Linux operating system. It generates a native binary for deployment. ```bash # check java vm java --version #> openjdk 21.0.2 2024-01-16 #> OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30) #> OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing) # run maven build via local GraalVM (Linux OS required!)mvn -DskipTests=true -Pci-build package -Dnative \ -f ../quarkus/quarkus-app/pom.xml ``` -------------------------------- ### Building EPCIS Testdata Generator from Source (Bash) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This set of Bash commands outlines the process of building the EPCIS testdata-generator project from its source code using Maven. It covers cloning the repository, performing a clean install, skipping tests, enabling code coverage, and building a native image. ```bash # Clone the repository git clone https://github.com/openepcis/epcis-testdata-generator.git cd epcis-testdata-generator # Build with Maven mvn clean install # Build without running tests mvn clean install -DskipTests # Build with code coverage mvn clean verify -Pcoverage # Build native image (requires GraalVM) mvn clean package -Pnative ``` -------------------------------- ### Run Testdata Generator with Docker Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/README.md This command runs the OpenEPCIS Test Data Generator container using Docker. It maps port 8080 and ensures the container is removed upon exit. Requires Docker to be installed and is subject to Docker's license restrictions for commercial use. ```bash docker run --rm -t --name testdata-generator -p 8080:8080 ghcr.io/openepcis/testdata-generator:0.9.4 ``` -------------------------------- ### Generate AggregationEvent with GS1 Digital Link WebURI Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt Generates an AggregationEvent using GS1 Digital Link WebURI format. This example demonstrates setting up parent and child EPCs, defining event type, action, business step, and using WebURI for identifiers. The response includes GS1 Digital Link URIs for the generated event. ```bash curl -X POST http://localhost:8080/api/generateTestData?pretty=true \ -H "Content-Type: application/json" \ -d '{ "events": [{ "nodeId": 1, "eventType": "AggregationEvent", "eventCount": 5, "locationPartyIdentifierSyntax": "WebURI", "dlURL": "https://id.gs1.org", "ordinaryEvent": true, "action": "ADD", "eventID": true, "eventIdType": "HashId", "hashAlgorithm": "sha-256", "eventTime": { "timeZoneOffset": "+00:00", "fromTime": "2024-06-01T00:00:00Z", "toTime": "2024-06-30T23:59:59Z" }, "businessStep": "PACKING", "disposition": "IN_PROGRESS", "parentReferencedIdentifier": { "identifierId": 2, "epcCount": 1 }, "referencedIdentifier": [{ "identifierId": 1, "epcCount": 24 }] }], "identifiers": [ { "identifierId": 1, "objectIdentifierSyntax": "WebURI", "dlURL": "https://id.gs1.org", "instanceData": { "sgtin": { "identifierType": "sgtin", "sgtin": "09521141012345", "serialType": "range", "rangeFrom": 5000, "count": 24 } } }, { "identifierId": 2, "objectIdentifierSyntax": "WebURI", "instanceData": { "sscc": { "identifierType": "sscc", "sscc": "106141412345678901", "serialType": "range", "rangeFrom": 100, "count": 1 } } } ] }' ``` -------------------------------- ### Example EPCIS Event and Identifier Data Structure (JSON) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This JSON structure demonstrates how to define an EPCIS event, specifically an ObjectEvent with associated quantity information and class identifiers. It includes details like event type, timestamps, business steps, and referenced identifiers with their quantities and units of measure. ```json { "events": [{ "nodeId": 1, "eventType": "ObjectEvent", "eventCount": 10, "locationPartyIdentifierSyntax": "URN", "ordinaryEvent": true, "action": "ADD", "eventTime": { "timeZoneOffset": "+00:00", "fromTime": "2024-01-01T00:00:00Z", "toTime": "2024-12-31T23:59:59Z" }, "businessStep": "COMMISSIONING", "disposition": "ACTIVE", "referencedIdentifier": [{ "identifierId": 1, "classCount": 20 }] }], "identifiers": [{ "identifierId": 1, "objectIdentifierSyntax": "URN", "classData": { "lgtin": { "identifierType": "lgtin", "gcpLength": 10, "gtin": "09521141012345", "lot": "LOT2024A", "classIdentifiersCount": 20, "quantityType": "CONSTANT", "quantity": 100.5, "uom": "KGM" } } }] } ``` -------------------------------- ### JSON Configuration for Range-Based Serial Numbers (JSON) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This JSON snippet illustrates how to configure identifier generation for SGITN with range-based serial numbers. It specifies the identifier ID, syntax, and details for the SGITN, including the base serial number, the range from which to start, and the total count of serial numbers to generate. ```json { "identifiers": [{ "identifierId": 1, "objectIdentifierSyntax": "URN", "instanceData": { "sgtin": { "identifierType": "sgtin", "gcpLength": 10, "sgtin": "09521141012345", "serialType": "range", "rangeFrom": 1000, "count": 500 } } }] } ``` -------------------------------- ### POST /api/generateTestData - Generate Error Declaration Events Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This endpoint generates test data, specifically demonstrating the creation of ObjectEvents with error declarations. It allows for specifying event details, identifiers, and includes an example of a response containing error declaration information. ```APIDOC ## POST /api/generateTestData - Generate Error Declaration Events ### Description Generates test data including ObjectEvents with error declarations. Allows specification of event parameters, identifiers, and provides an example of a successful response. ### Method POST ### Endpoint http://localhost:8080/api/generateTestData ### Parameters #### Request Body - **events** (array) - Required - List of events to generate. - **nodeId** (integer) - Required - The node ID for the event. - **eventType** (string) - Required - The type of EPCIS event (e.g., "ObjectEvent"). - **eventCount** (integer) - Required - The number of events to generate. - **locationPartyIdentifierSyntax** (string) - Required - Syntax for location party identifiers. - **ordinaryEvent** (boolean) - Required - Indicates if the event is ordinary. - **action** (string) - Required - The action associated with the event (e.g., "OBSERVE"). - **eventID** (boolean) - Required - Whether to generate a unique event ID. - **eventTime** (object) - Required - The time period for the event. - **timeZoneOffset** (string) - Required - The time zone offset (e.g., "+00:00"). - **fromTime** (string) - Required - The start time in ISO 8601 format. - **toTime** (string) - Required - The end time in ISO 8601 format. - **businessStep** (string) - Required - The business step associated with the event. - **disposition** (string) - Required - The disposition of the event. - **referencedIdentifier** (array) - Optional - Identifiers referenced by this event. - **identifierId** (integer) - Required - The ID of the referenced identifier. - **epcCount** (integer) - Required - The count of EPCs. - **errorDeclaration** (object) - Optional - Details for an error declaration. - **declarationTime** (string) - Required - The time of the declaration. - **reason** (string) - Required - The reason for the error. - **correctiveEventIDs** (array) - Optional - List of corrective event IDs. - **identifiers** (array) - Required - List of identifiers to be used. - **identifierId** (integer) - Required - The unique ID for the identifier. - **objectIdentifierSyntax** (string) - Required - The syntax for object identifiers (e.g., "URN"). - **instanceData** (object) - Required - The instance data for the identifier. - **sgtin** (object) - Required - Serialized Global Trade Item Number data. - **identifierType** (string) - Required - The type of identifier (e.g., "sgtin"). - **gcpLength** (integer) - Required - The length of the Global Company Prefix. - **sgtin** (string) - Required - The base SGtin value. - **serialType** (string) - Required - The type of serial number generation (e.g., "range"). - **rangeFrom** (integer) - Required if serialType is "range" - The starting serial number. - **count** (integer) - Required if serialType is "range" - The number of serial numbers to generate. ### Request Example ```json { "events": [ { "nodeId": 1, "eventType": "ObjectEvent", "eventCount": 2, "locationPartyIdentifierSyntax": "URN", "ordinaryEvent": false, "action": "OBSERVE", "eventID": true, "eventTime": { "timeZoneOffset": "+00:00", "fromTime": "2024-03-01T00:00:00Z", "toTime": "2024-03-31T23:59:59Z" }, "businessStep": "RECEIVING", "disposition": "IN_PROGRESS", "referencedIdentifier": [ { "identifierId": 1, "epcCount": 10 } ], "errorDeclaration": { "declarationTime": "2024-03-25T14:30:00Z", "reason": "DID_NOT_OCCUR", "correctiveEventIDs": [ "urn:uuid:404d95fc-9457-4a51-bd6a-0bba133845a8" ] } } ], "identifiers": [ { "identifierId": 1, "objectIdentifierSyntax": "URN", "instanceData": { "sgtin": { "identifierType": "sgtin", "gcpLength": 10, "sgtin": "30614141234567", "serialType": "range", "rangeFrom": 100, "count": 10 } } } ] } ``` ### Response #### Success Response (200) - **epcisBody** (object) - The EPCIS document body. - **eventList** (array) - A list of generated EPCIS events. - **type** (string) - The type of the event. - **eventTime** (string) - The time the event occurred. - **action** (string) - The action of the event. - **bizStep** (string) - The business step of the event. - **epcList** (array) - A list of EPCs associated with the event. - **errorDeclaration** (object) - Details of the error declaration. - **declarationTime** (string) - The time of the declaration. - **reason** (string) - The reason for the error. - **correctiveEventIDs** (array) - List of corrective event IDs. #### Response Example ```json { "epcisBody": { "eventList": [ { "type": "ObjectEvent", "eventTime": "2024-03-12T08:45:22Z", "action": "OBSERVE", "bizStep": "urn:epcglobal:cbv:bizstep:receiving", "epcList": [ "urn:epc:id:sgtin:3061414.123456.100", "urn:epc:id:sgtin:3061414.123456.101" ], "errorDeclaration": { "declarationTime": "2024-03-25T14:30:00Z", "reason": "did_not_occur", "correctiveEventIDs": [ "urn:uuid:404d95fc-9457-4a51-bd6a-0bba133845a8" ] } } ] } } ``` ``` -------------------------------- ### Copy Native Binary for Azure Function Deployment Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/azure-function/README.md Copies the compiled native executable from the Maven build output directory to a file named 'application'. This prepares the binary for deployment within the Azure Functions environment. ```bash # copy binary from build to 'application' cp ../quarkus/quarkus-app/target/testdata-generator-quarkus-rest-app-runner application ``` -------------------------------- ### Podman Deployment Command (Bash) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This Bash command demonstrates how to run the EPCIS testdata-generator using Podman, an alternative containerization platform to Docker. It pulls the image and exposes the default port 8080. ```bash # Run with Podman (Docker alternative) podman run --rm -t --name testdata-generator \ -p 8080:8080 \ ghcr.io/openepcis/testdata-generator:0.9.4 ``` -------------------------------- ### Docker Deployment Commands (Bash) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This section provides Bash commands for deploying the EPCIS testdata-generator using Docker. It covers pulling the latest image, running with default and custom ports, and enabling SSL/HTTPS support by mounting a certificates volume. ```bash # Pull and run the latest image docker run --rm -t --name testdata-generator \ -p 8080:8080 \ ghcr.io/openepcis/testdata-generator:0.9.4 # Access services # Web UI: http://localhost:8080/ui/ # Swagger API: http://localhost:8080/q/swagger-ui/ # Run with custom port docker run --rm -t --name testdata-generator \ -p 9000:8080 \ ghcr.io/openepcis/testdata-generator:0.9.4 # Run with SSL/HTTPS support (requires certificates) docker run --rm -t --name testdata-generator \ -p 8080:8080 \ -p 8443:8443 \ -v $(pwd)/ssl:/app/ssl \ ghcr.io/openepcis/testdata-generator:0.9.4 ``` -------------------------------- ### Create Azure Functions App Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/azure-function/README.md Deploys an Azure Functions App using the Azure CLI. This command specifies the app name, resource group, region, OS type (Linux), runtime (custom), functions version, and associated storage account. It sets up the environment to host the custom application. ```bash # create an Azure Functions App az functionapp create -n yourunique-epcis-event-hash-app-name \ -g rg-openepcis-functions \ --consumption-plan-location eastus\ --os-type Linux \ --runtime custom \ --functions-version 4 \ --storage-account sargopenepcisfunctions ``` -------------------------------- ### Build Quarkus Native Executable using Docker Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/azure-function/README.md Compiles the Quarkus application into a native executable using Maven within a Docker container. This method is recommended for building a self-contained, platform-independent binary suitable for Azure deployment. Requires Docker or Podman. ```bash # run maven build via docker build (docker or podman required!)mvn -DskipTests=true -Pci-build package -Dnative \ -Dquarkus.native.container-build=true \ -f ../quarkus/quarkus-app/pom.xml ``` -------------------------------- ### Standalone JAR Execution (Bash) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt These Bash commands illustrate how to run the EPCIS testdata-generator as a standalone JAR file. It includes downloading the latest release from GitHub and executing it with Java, including options for custom JVM arguments and ports. ```bash # Download latest release from GitHub wget https://github.com/openepcis/epcis-testdata-generator/releases/latest/download/testdata-generator-quarkus-rest-app.jar # Run with Java 17+ java -jar testdata-generator-quarkus-rest-app.jar # Run with custom JVM options java -Xmx2g -Xms512m \ -Dquarkus.http.port=9090 \ -jar testdata-generator-quarkus-rest-app.jar ``` -------------------------------- ### Generate EPCIS Test Data Events using EPCISEventGenerator in Java Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/README.md This code snippet demonstrates the direct usage of the EPCISEventGenerator class to generate EPCIS test data events. It requires a pre-defined JSON inputTemplate and collects the generated events, printing each one to the console. The output can be lengthy depending on the generated events. It relies on the 'openepcis-models' package for event structures. ```java import io.openepcis.testdata.generator.EPCISEventGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import java.util.concurrent.CompletionException; // Assuming inputTemplate is a String containing the JSON structure String inputTemplate = "{\"events\": [{\"nodeId\": 1, \"eventType\": \"ObjectEvent\", \"eventCount\": 5, \"locationPartyIdentifierSyntax\": \"URN\", \"ordinaryEvent\": true, \"action\": \"ADD\", \"eventID\": true, \"eventTime\": { \"timeZoneOffset\": \"+02:00\", \"fromTime\": \"2022-04-01T18:30:04+02:00\", \"toTime\": \"2022-04-05T18:30:04+02:00\" }, \"recordTimeType\": \"CURRENT_TIME\", \"businessStep\": \"COMMISSIONING\", \"disposition\": \"ACTIVE\", \"referencedIdentifier\": [{ \"identifierId\": 1, \"epcCount\": 10, \"classCount\": 5 }], \"parentReferencedIdentifier\": {}, \"outputReferencedIdentifier\": [] }], \"identifiers\": [{\"identifierId\": 1, \"objectIdentifierSyntax\": \"URN\", \"instanceData\": { \"sgtin\": { \"identifierType\": \"sgtin\", \"gcpLength\": 10, \"sgtin\": \"89384989388934\", \"serialType\": \"range\", \"rangeFrom\": 100, \"rangeTo\": 110 } }, \"classData\": { \"grai\": { \"identifierType\": \"grai\", \"gcpLength\": 10, \"quantityType\": null, \"uom\": null, \"serialType\": \"\", \"grai\": \"8384783874378\", \"classIdentifiersCount\": 5 } }, \"parentData\": null }]}"; EPCISEventGenerator.generate(inputTemplate).collect().asList().await().indefinitely().forEach(e -> { try { System.out.println(e.toString()); } catch (JsonProcessingException ex) { throw new CompletionException(ex); } }); ``` -------------------------------- ### Deploy Function to Azure Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/azure-function/README.md Publishes the custom application to the previously created Azure Functions App. This command uses the Azure Functions Core Tools to deploy the application package. Ensure you are in the correct directory containing the deployment artifacts. ```bash func azure functionapp publish yourunique-epcis-event-hash-app-name ``` -------------------------------- ### Create EPCIS Event Models with Java Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This Java snippet illustrates how to create event creation models using the OpenEPCIS Test Data Generator library without immediately generating the full EPCIS events. This is useful for inspecting event structures or performing custom processing on the models. It requires an InputTemplate and returns a list of EventCreationModel objects. ```java import io.openepcis.testdata.generator.EPCISEventGenerator; import io.openepcis.testdata.generator.model.EventCreationModel; import io.openepcis.testdata.generator.template.InputTemplate; import io.openepcis.model.epcis.EPCISEvent; import java.util.List; InputTemplate inputTemplate = // ... load template // Create event creation models for inspection or custom processing List> models = EPCISEventGenerator.createModels(inputTemplate); models.forEach(model -> { System.out.println("Model for event type: " + model.getEventType()); System.out.println("Event count: " + model.getEventCount()); System.out.println("Identifiers: " + model.getIdentifiers()); }); ``` -------------------------------- ### Create Azure Resource Group and Storage Account Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/azure-function/README.md Utilizes the Azure CLI to create a resource group and a storage account. These are fundamental Azure resources required before creating an Azure Functions App. The storage account is essential for Azure Functions. ```bash # login $ az login # create an Azure Resource Group az group create -n rg-openepcis-functions \ -l eastus # create an Azure Storage Account (required for Azure Functions App) az storage account create -n sargopenepcisfunctions \ -g rg-openepcis-functions \ -l eastus ``` -------------------------------- ### Generate EPCIS Events Programmatically with Java Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This snippet demonstrates how to use the OpenEPCIS Test Data Generator Java library to programmatically generate EPCIS 2.0 events. It takes an InputTemplate JSON configuration, generates a stream of EPCISEvents, collects them into a list, and prints details of each generated event. Dependencies include the core generator library and Jackson for JSON processing. ```java import io.openepcis.testdata.generator.EPCISEventGenerator; import io.openepcis.testdata.generator.template.InputTemplate; import com.fasterxml.jackson.databind.ObjectMapper; import io.openepcis.model.epcis.EPCISEvent; // Prepare InputTemplate JSON configuration String inputTemplateJson = """ { "events": [{ "nodeId": 1, "eventType": "ObjectEvent", "eventCount": 100, "locationPartyIdentifierSyntax": "URN", "ordinaryEvent": true, "action": "ADD", "eventID": true, "eventIdType": "UUID", "eventTime": { "timeZoneOffset": "+02:00", "fromTime": "2024-01-01T10:00:00+02:00", "toTime": "2024-01-31T18:00:00+02:00" }, "recordTimeType": "CURRENT_TIME", "businessStep": "COMMISSIONING", "disposition": "ACTIVE", "readPoint": { "gln": "6223002970001" }, "bizLocation": { "gln": "6223004510007" }, "referencedIdentifier": [{ "identifierId": 1, "epcCount": 50, "classCount": 0 }] }], "identifiers": [{ "identifierId": 1, "objectIdentifierSyntax": "URN", "instanceData": { "sgtin": { "identifierType": "sgtin", "gcpLength": 10, "sgtin": "09521141012345", "serialType": "range", "rangeFrom": 1000, "rangeTo": 2000 } } }] } """; ObjectMapper mapper = new ObjectMapper(); InputTemplate inputTemplate = mapper.readValue(inputTemplateJson, InputTemplate.class); // Generate events reactively EPCISEventGenerator.generate(inputTemplate) .collect().asList() .await().indefinitely() .forEach(event -> { System.out.println("Generated Event: " + event.getEventID()); System.out.println("Event Type: " + event.getType()); System.out.println("Event Time: " + event.getEventTime()); }); ``` -------------------------------- ### Generate EPCIS Events from InputTemplate (Java) Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/testdata-generator-common/README.md This code snippet demonstrates how to use the EPCISEventCreator to generate a list of EPCIS events from a provided InputTemplate JSON. It requires the Open EPCIS Core library and Java 17. The output is a stream of EPCIS events, which are then printed to the console. ```Java EPCISEventCreator.generate(InputTemplate).collect().asList().await().indefinitely().forEach(e -> { try { System.out.println(e.toString()); } catch (JsonProcessingException ex) { throw new CompletionException(ex); } }); ``` -------------------------------- ### Convert JSON Events to XML using Multiple Curl Commands (Bash) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This snippet demonstrates a two-step process using curl to first generate EPCIS events in JSON format and then pipe the output to another curl command that converts the JSON to EPCIS 2.0 XML format. It shows how to configure event details and identifiers for generation, and the expected XML output. ```bash # Generate events and convert to EPCIS 2.0 XML curl -X POST http://localhost:8080/api/generateTestData \ -H "Content-Type: application/json" \ -d '{ \ "events": [{ \ "nodeId": 1, \ "eventType": "ObjectEvent", \ "eventCount": 2, \ "locationPartyIdentifierSyntax": "URN", \ "ordinaryEvent": true, \ "action": "ADD", \ "eventID": false, \ "eventTime": { \ "timeZoneOffset": "+02:00", \ "fromTime": "2024-01-01T10:00:00+02:00", \ "toTime": "2024-01-31T18:00:00+02:00" \ }, \ "businessStep": "COMMISSIONING", \ "disposition": "ACTIVE", \ "referencedIdentifier": [{ \ "identifierId": 1, \ "epcCount": 5 \ }] \ }], \ "identifiers": [{ \ "identifierId": 1, \ "objectIdentifierSyntax": "URN", \ "instanceData": { \ "sgtin": { \ "identifierType": "sgtin", \ "gcpLength": 10, \ "sgtin": "09521141012345", \ "serialType": "range", \ "rangeFrom": 1, \ "count": 5 \ } \ } \ }] \ }' | \ curl -X POST http://localhost:8080/api/generateTestDataXML \ -H "Content-Type: application/json" \ --data-binary @- # XML Response 2024-01-15T14:23:11+02:00 2024-03-15T10:45:30Z +02:00 urn:epc:id:sgtin:0952114.101234.1 urn:epc:id:sgtin:0952114.101234.2 ADD urn:epcglobal:cbv:bizstep:commissioning urn:epcglobal:cbv:disp:active ``` -------------------------------- ### Generate Transformation Events with Input/Output Products using curl Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This snippet demonstrates how to generate EPCIS TransformationEvents using a `curl` command. It specifies input and output EPCs, event details, and identifiers. The response includes the generated event with input and output EPC lists. ```bash curl -X POST http://localhost:8080/api/generateTestData \ -H "Content-Type: application/json" \ -d '{ "events": [{ "nodeId": 1, "eventType": "TransformationEvent", "eventCount": 3, "locationPartyIdentifierSyntax": "URN", "ordinaryEvent": true, "eventID": true, "eventTime": { "timeZoneOffset": "+02:00", "fromTime": "2024-04-01T06:00:00+02:00", "toTime": "2024-04-30T20:00:00+02:00" }, "businessStep": "COMMISSIONING", "disposition": "ACTIVE", "bizLocation": { "gln": "4012345000009" }, "referencedIdentifier": [{ "identifierId": 1, "epcCount": 100 }], "outputReferencedIdentifier": [{ "identifierId": 2, "epcCount": 50 }] }], "identifiers": [ { "identifierId": 1, "objectIdentifierSyntax": "URN", "instanceData": { "sgtin": { "identifierType": "sgtin", "sgtin": "30614141234567", "serialType": "range", "rangeFrom": 1, "count": 100 } } }, { "identifierId": 2, "objectIdentifierSyntax": "URN", "instanceData": { "sgtin": { "identifierType": "sgtin", "sgtin": "40614141765432", "serialType": "range", "rangeFrom": 2000, "count": 50 } } } ] }' # Response includes input and output EPCs { "epcisBody": { "eventList": [{ "type": "TransformationEvent", "eventTime": "2024-04-12T14:25:33+02:00", "eventID": "urn:uuid:6f8e2d1c-9a4b-4e7d-8c2f-5a1b3c7e9d4f", "bizStep": "urn:epcglobal:cbv:bizstep:commissioning", "disposition": "urn:epcglobal:cbv:disp:active", "bizLocation": { "id": "urn:epc:id:sgln:4012345.00000.0" }, "inputEPCList": [ "urn:epc:id:sgtin:3061414.123456.1", "urn:epc:id:sgtin:3061414.123456.2" ], "outputEPCList": [ "urn:epc:id:sgtin:4061414.765432.2000", "urn:epc:id:sgtin:4061414.765432.2001" ] }] } } ``` -------------------------------- ### Maven Dependencies for Testdata Generator (XML) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This XML snippet shows how to add the EPCIS testdata-generator as a dependency to a Maven project. It includes the common library, EPCIS data models, and the event hash ID generator, along with the necessary repository configuration for snapshots. ```xml io.openepcis testdata-generator-common 999-SNAPSHOT io.openepcis openepcis-model-epcis 999-SNAPSHOT io.openepcis openepcis-event-hash-generator 999-SNAPSHOT sonatype-staging https://s01.oss.sonatype.org/content/repositories/snapshots ``` -------------------------------- ### Generate EPCIS Events with cURL Source: https://github.com/openepcis/epcis-testdata-generator/blob/main/examples/api requests/readme.md This snippet demonstrates how to generate EPCIS events using a cURL command. It sends a POST request to the Test Data Generator API with a JSON payload specifying event details and identifiers. The input template within the '-d' argument can be modified to customize the generated events. ```bash curl -X 'POST' \ 'http://localhost:8080/api/generateTestData?pretty=true' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "events": [ { "nodeId": 1, "eventType": "ObjectEvent", "eventCount": 10, "locationPartyIdentifierSyntax": "URN", "ordinaryEvent": true, "action": "ADD", "eventID": false, "eventTime": { "timeZoneOffset": "+02:00", "fromTime": "2022-10-01T10:22:16+02:00", "toTime": "2022-10-31T10:22:16+02:00" }, "businessStep": "COMMISSIONING", "disposition": "ACTIVE", "referencedIdentifier": [ { "identifierId": 1, "epcCount": 10, "classCount": 0 } ], "parentReferencedIdentifier": {}, "outputReferencedIdentifier": [] } ], "identifiers": [ { "identifierId": 1, "objectIdentifierSyntax": "URN", "instanceData": { "sgtin": { "identifierType": "sgtin", "gcpLength": 10, "sgtin": "40584954485984", "serialType": "random", "randomCount": 10, "randomType": "NUMERIC", "randomMinLength": 2, "randomMaxLength": 10 } }, "classData": null, "parentData": null } ] }' ``` -------------------------------- ### JSON Configuration for Random Serial Numbers with Seed (JSON) Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt This JSON configuration demonstrates how to generate SGITN identifiers with random serial numbers, using a specified seed for reproducibility. It defines the identifier syntax, SGITN details, and parameters for random serial number generation, including type, and length constraints. It also includes a separate section for configuring random generators with their seeds. ```json { "identifiers": [{ "identifierId": 1, "objectIdentifierSyntax": "WebURI", "instanceData": { "sgtin": { "identifierType": "sgtin", "sgtin": "30614141234567", "serialType": "random", "randomType": "ALPHANUMERIC", "randomMinLength": 8, "randomMaxLength": 12 } } }], "randomGenerators": [{ "randomId": 1, "seed": 1742915939920 }] } ``` -------------------------------- ### POST /api/generateTestData - Transformation Events Source: https://context7.com/openepcis/epcis-testdata-generator/llms.txt Generates Transformation Events with specified input and output products. This endpoint allows for the creation of events that represent the transformation of goods, detailing what went in and what came out. ```APIDOC ## POST /api/generateTestData - Transformation Events ### Description This endpoint generates EPCIS Transformation Events, specifying input and output products, event details, and identifiers. It's useful for simulating manufacturing or processing steps. ### Method POST ### Endpoint /api/generateTestData ### Parameters #### Request Body - **events** (array) - Required - List of event configurations to generate. - **nodeId** (integer) - Required - Internal node identifier. - **eventType** (string) - Required - Must be 'TransformationEvent'. - **eventCount** (integer) - Required - Number of events to generate. - **locationPartyIdentifierSyntax** (string) - Required - Syntax for location identifiers (e.g., 'URN'). - **ordinaryEvent** (boolean) - Required - Flag for ordinary event. - **eventID** (boolean or string) - Required - Whether to generate a random event ID or provide a specific one. - **eventTime** (object) - Required - Time configuration for the event. - **timeZoneOffset** (string) - Required - Time zone offset (e.g., '+02:00'). - **fromTime** (string) - Required - Start time for event generation (ISO 8601 format). - **toTime** (string) - Required - End time for event generation (ISO 8601 format). - **businessStep** (string) - Required - Business step identifier (e.g., 'COMMISSIONING'). - **disposition** (string) - Required - Event disposition (e.g., 'ACTIVE'). - **bizLocation** (object) - Optional - Business location details. - **gln** (string) - Required if bizLocation is present - Global Location Number. - **referencedIdentifier** (array) - Required - Input products for the transformation. - **identifierId** (integer) - Required - ID of the identifier definition. - **epcCount** (integer) - Required - Number of EPCs for this identifier. - **outputReferencedIdentifier** (array) - Required - Output products from the transformation. - **identifierId** (integer) - Required - ID of the identifier definition. - **epcCount** (integer) - Required - Number of EPCs for this identifier. - **identifiers** (array) - Required - Definitions of identifiers to be used. - **identifierId** (integer) - Required - Unique identifier for this definition. - **objectIdentifierSyntax** (string) - Required - Syntax for object identifiers (e.g., 'URN'). - **instanceData** (object) - Required - Data for generating specific EPC instances. - **sgtin** (object) - Required if using SGTIN. - **identifierType** (string) - Required - Must be 'sgtin'. - **sgtin** (string) - Required - Base SGTIN value. - **serialType** (string) - Required - Type of serial number generation ('range'). - **rangeFrom** (integer) - Required - Starting serial number. - **count** (integer) - Required - Number of serial numbers to generate. ### Request Example ```json { "events": [ { "nodeId": 1, "eventType": "TransformationEvent", "eventCount": 3, "locationPartyIdentifierSyntax": "URN", "ordinaryEvent": true, "eventID": true, "eventTime": { "timeZoneOffset": "+02:00", "fromTime": "2024-04-01T06:00:00+02:00", "toTime": "2024-04-30T20:00:00+02:00" }, "businessStep": "COMMISSIONING", "disposition": "ACTIVE", "bizLocation": { "gln": "4012345000009" }, "referencedIdentifier": [ { "identifierId": 1, "epcCount": 100 } ], "outputReferencedIdentifier": [ { "identifierId": 2, "epcCount": 50 } ] } ], "identifiers": [ { "identifierId": 1, "objectIdentifierSyntax": "URN", "instanceData": { "sgtin": { "identifierType": "sgtin", "sgtin": "30614141234567", "serialType": "range", "rangeFrom": 1, "count": 100 } } }, { "identifierId": 2, "objectIdentifierSyntax": "URN", "instanceData": { "sgtin": { "identifierType": "sgtin", "sgtin": "40614141765432", "serialType": "range", "rangeFrom": 2000, "count": 50 } } } ] } ``` ### Response #### Success Response (200) - **epcisBody** (object) - The generated EPCIS event data. - **eventList** (array) - List of generated events. - **type** (string) - Type of the event (e.g., 'TransformationEvent'). - **eventTime** (string) - Timestamp of the event. - **eventID** (string) - Unique identifier for the event. - **bizStep** (string) - Business step associated with the event. - **disposition** (string) - Disposition of the event. - **bizLocation** (object) - Business location details. - **id** (string) - Identifier of the business location. - **inputEPCList** (array) - List of EPCs used as input. - **outputEPCList** (array) - List of EPCs produced as output. #### Response Example ```json { "epcisBody": { "eventList": [ { "type": "TransformationEvent", "eventTime": "2024-04-12T14:25:33+02:00", "eventID": "urn:uuid:6f8e2d1c-9a4b-4e7d-8c2f-5a1b3c7e9d4f", "bizStep": "urn:epcglobal:cbv:bizstep:commissioning", "disposition": "urn:epcglobal:cbv:disp:active", "bizLocation": { "id": "urn:epc:id:sgln:4012345.00000.0" }, "inputEPCList": [ "urn:epc:id:sgtin:3061414.123456.1", "urn:epc:id:sgtin:3061414.123456.2" ], "outputEPCList": [ "urn:epc:id:sgtin:4061414.765432.2000", "urn:epc:id:sgtin:4061414.765432.2001" ] } ] } } ``` ```