Adding tracking state

Event Adding tracking state is triggered by an attempt to add a Tracking state to business object or one its line items.

This event can be used to trigger event handling related to adding tracking state entries before tracking state transformations are validated against applicable Tracking state workflows, if any.

The data context for event handling is the Tracking state owner – i. e. a business object or one if its line items – as identified by the properties statusOwner (class) and statusOwnerId (Objekt-ID) of the tracking state entry.

Within event handlers the tracking state entry to be added can be addressed for reading and writing via Variable trackingStatusEntry with a reference to class Tracking state entry (de.lobster.scm.base.ts.trackingstatus.entry.TrackingStatusEntry).

Configuration example

Adding any tracking state for an Order or Order line item should be prevented by definition and independent of regulations by Tracking state workflows, if a tracking state entry referring to the same tracking state code already exists for the the same owner object (order or order line item).

images/download/attachments/36571097/image2019-5-14_15-51-53-version-1-modificationdate-1557841916000-api-v2.png

  • Event Adding tracking state is configured as the only triggering event to handle.

  • The Validating rule checks for types 'Order' or 'Order line item' by Check type rules.

  • Further, the Check existence rule seeks existing tracking state entries that resemble certain values of the new entry. Configuration details are documented in the screenshot below.

  • The Abort (with a notification message) is only executed, if the new entry is qualified as a 'duplicate' to at least one existing entry.

The 'duplicate search' inside the Check existence rule is configures as pointed out below:

images/download/attachments/36571097/image2019-5-14_16-6-40-version-1-modificationdate-1557842804000-api-v2.png

  • The Where condition checks property projections Owner (statusOwner), statusOwnerId (statusOwnerId) and Trackingstatus-Code.Code (trackingStatus.code) for all visible tracking state entries in the system (left side of all three conditions).

  • Each conditions compares against the value from the same field in the new tracking state entry (right side of all three conditions), which is addressed via variable trackingStateEntry with type Tracking state entry.