Propagate working state
Event action – Abstract
Purpose: Attempts to add the working state just added to a manifest as well as to the Shipments contained as manifest items.
The event action Propagate working state is used to add the working state just added to a business transaction object of the 'Manifest' type (see Manifests) as well as to the Shipments contained as manifest items.
►IMPORTANT◄ 'Propagation' works only within an event handling triggered by the corresponding working state event (see Working state (Events)). If the same event handling should propagate different Working state, the corresponding events must be explicitly configured as triggers. However, there is no possibility to propagate 'all' working states to the Shipments of a manifest via the event action Propagate working state.
CAUTION
Within a working state event (see Working state (Events)), the working state just added is already set in the 'Current working state' (currentWorkingstate) field of the reference object. However, this entry is only saved if the transaction is completed successfully. The occurrence of an error or execution of an Abort, on the other hand, causes a rollback. If the 'propagation' of the working state fails because it cannot be added to at least one of the Shipments contained in the manifest due to contraints by any applicable Working state matrix, this means the working state change for the manifest also fails.
CAUTION
As far as the event action Propagate working state has read or write access to Shipments or their working state entries in the course of propagation, this is done without any consideration of permissions or access restrictions.
Configuration
The event action can only be used meaningfully with a manifest (see Manifests) as the reference object. The propagation of the working state only works with a working state event (see Working state (Events)) as a trigger (see above).
|
|
By default, the Reason parameter provides for the direct entry (on the left of the screenshot) of a static text that will appear in the course of propagation to the reason field in the working state object when it is assigned to a shipment.
Alternatively, a value resolver can be defined by clicking on the gray arrow at the bottom left to dynamically assign a text value for the same field. The example on the right in the screenshot (above) shows how an Object property value resolver can be used to propagate the 'reason' from the manifest's 'Current working state' (currentWorkingstate.reason field) for all Shipments. The 'reason' is not automatically propagated if no text is specified or no value resolver is configured!
►NOTE◄ In addition to the Reason (reason), the working state object also contains the 'realization time' (realization) field, which should indicate the time when the working state became effective. In the course of propagation, the current system time is automatically assigned to this – similar to the interactive addition of a working state via the ribbon. The optional assignment of a time is not considered here.
Example
For selected working state changes for Manifests ('Released', 'Delivery', 'Canceled'), the added working state should be propagated to all contained Shipments, if there is at least one shipment among them whose current working state differs from the added one.
As an indication of the 'originator' of the status change, the name of the role from the context of the session should be entered in the Reason field for the working states created in the course of propagation (for Shipments).
Configuration:
The desired Working state (Events) are assigned as Triggering events. The Validating rule uses a Check type to ensure that a manifest is present as the reference object. The Action on passed rule is configured as shown to the right:
|
|
The rule in the If then else event action is configured as shown on the right:
►NOTE◄ An 'Else' branch is not needed, since there is nothing to do if the working state of all contained items already matches the working state just added to the manifest. However, if the propagation is executed, the respective working state (incl. 'Reason') will also be reassigned to the shipments whose workingState already previously matched the manifest. |
|