Added tracking state
The Added tracking state event is triggered, when a Tracking state has been added successfully to a business object or one of its line items.
As far as Tracking state workflows are applicable, the tracking state transformation is validated before the event is triggered. Thus the event is only triggered if the intended tracking status change is valid according to applicable Tracking state workflows. To execute event handing before the validation of Tracking state workflows, refer to the event Adding tracking state as a trigger.
The data context for this event is the 'Status Owner' (statusOwner) – a business object of one of its line items – to which the new tracking state entry has been added (see Working with tracking states).
Event handling can address the created tracking state entry (see Tracking state history) for reading and writing via Variable trackingStateEntry with class Tracking state entry (de.lobster.scm.base.ts.trackingStatus.entry.TrackingStatusEntry).
Configuration example
After a tracking state has been added successfully to an order line item, a check should verify, if the added tracking state is referred to by the tracking state attribute for Tracking state type 'Current' (CURRENT) of the order line item.
This verification may fail, e.g. if the added entry was merged into the chronological history according to its External input date/time at a position which makes it irrelevant for the current tracking state. This might be the intention of a user, but could as well be a symptom of incorrect input for External input date/time. Since this value cannot be updated once a tracking state entry has been created and tracking state entries cannot be deleted by definition, a User callback action should let the user decide whether to merge or cancel the input.
The event handler responds to the Added tracking state event.
The Validating rule limits the scope for event handing by a Check type rule checking for object type 'Order line item'. As far as rules and actions in the event handler are applicable for other object types, these can be added by disjunctions to this rule.
The following Entity property rule checks, if the order line item from the data context features a Tracking state attribute of Subtype 'Current' (CURRENT) pointing to a tracking state entry other than the one just added.
In case the added tracking state entry was not registered as 'Current', the User callback action prompts the user for a decision and calls an Abort depending on the response.
►NOTE◄ Cancelling the transaction rolls back all changes, including the creation of the tracking state entry as well as the update of the tracking state attribute of the order line item.