General message processing logic
A generic approach is applied for processing business messages in Bulkchain. Please find below the different steps which are executed by Bulkchain when processing a message.
Technical validation
A technical validation will be executed by Bulkchain synchronously upon submission of a message (for example: “Terminal Delivery Order”). This technical validation comprises of two steps. During the first step, a JSON format validation is performed and in the second step, a validation on some additional technical rules is performed. These technical rules can be found in Technical and business validation | Technical-validation. In case technical errors are encountered, a negative technical validation response will be returned synchronously that contains the list of technical errors, in combination with a 400 HTTP code.
When the message is technically compliant and has successfully passed all technical rules defined by Bulkchain, a positive technical validation response will be returned which contains a unique correlation id as functional reference for the subsequent asynchronous notifications. This mechanism is applied for all messages that intend to create, update or delete an object in Bulkchain. Operations that intend to retrieve information from Bulkchain (GET calls) will get a synchronous API response containing the relevant data.
Business validation
Upon successful technical validation by Bulkchain, asynchronous processing will be done by Bulkchain. Here, a set of business rules will be validated upon the received request. In case one or more business validation errors are triggered, a notification will be sent out towards the original requester. This notification will contain a full list of business validation errors that have been encountered. For the full list of business rules and the related error codes, please refer to Technical and business validation | Business-validation.
Processing
When all business validations are passed, Bulkchain will continue the processing by executing the requested operation (for example create a Terminal Delivery Order, update a SKU,…).
Create
For object creation, a Bulkchain-generated key will be added to each individual object. This can be for example a TDO key in case of TDO creation or a SKU key in case of SKU creation. Next to that, the input attributes for the respective object will be stored in the Bulkchain database and a notification will be sent to the caller asynchronous.
Get
For a GET operation, the requested Bulkchain objected will be retrieved from the Bulkchain database and the dataset will be returned as a synchronous response to the caller.
Update
The object, identified by its Bulkchain key (for example SKU key), is updated with the distinct input attributes provided by the caller. The impact is that the attributes are overwritten in the Bulkchain database, which implies there’s no traceability in Bulkchain for previous attribute values. A notification will be sent to the caller asynchronous.
Delete
The object, identified by its Bulkchain key, will be archived as a result of the delete operation and a notification will be sent to the caller asynchronous. The impact of deleting an object is that it won’t be available anymore through any Bulkchain interface.
Notification
Bulkchain will send out a notification containing the business validation feedback for the requested operation. This notification will indicate the success or failure of the operation. Success notifications will be sent to all involved stakeholders (for example the LSP and TO in case of TDO creation), overview of available notifications: Success notifications. Failure notifications are sent to the original requestor only, overview of available notifications: Technical and business validation | Business-validation.