Added-tracking-state-rule

Rule types – Abstract

Purpose: Is 'passed' if the Tracking state entry contained in the trackingStatusEntry Variable refers to one of the Tracking state codes that the rule configuration specifies by a static multiple choice.


images/download/attachments/201666127/image2021-9-21_13-14-21-version-1-modificationdate-1743406107154-api-v2.png

The Added-tracking-state-rule is considered 'passed' if the Tracking state entry contained in the trackingStatusEntry Variable refers to one of the Tracking state codes that the rule's configuration specifies through a static multiple selection.

The rule is typically used in connection with one of the events that are triggered when a Tracking state is added for a business object (Tracking state (Events)). In their context, the trackingStatusEntry Variable automatically refers to the added or to the Tracking state entry to be added.

If the trackingStatusEntry Variable is empty or does not refer to an entity of the 'tracking state entry' type, the rule is considered 'failed'.

NOTE◄ The rule evaluates the trackingStatusEntry Variable regardless of whether the included tracking state was automatically assigned because it is being added. So it can be used to check the tracking state code of any tracking state entry against the positive list if it is assigned beforehand to this variable.

Configuration

The Added-tracking-state-rule configuration provides for static multiple selection via a Multiselect combobox with a search function, which offers for selection all Tracking state codes for which there is at least read access in the context of the configuration.

If no Tracking state are selected, the rule is always considered 'failed'.

NOTE◄ If there is no read access for an already selected Tracking state code, it will still appear in the selection. As long as such an entry is not specifically removed, it will remain in the list even if other entries are added or removed. Entries deselected by 'inversing' an existing selection, for which there is no access, do not reappear in the selection by 'inversing' them again.

images/download/attachments/201666127/image-2025-3-31_13-20-43-version-1-modificationdate-1743420043820-api-v2.png

Example

Whenever a specific Tracking state ('VIRGIN') has been successfully added to any reference object, it should be checked whether the current tracking state entry of this object refers to the same Tracking state code. If the 'current tracking state' differs from the currently assigned one according to the code, this should be reported to the user.

NOTE◄ The requirement described may seem elaborate or complicated at first glance. However, when adding Tracking state, unlike Working state, it may be that the last entry added differs from the one considered 'current'. On one hand, the 'External creation time' is taken into account when adding tracking state entries, so that 'backdated' entries are also sorted chronologically. On the other hand, depending on the applicable Tracking state workflows, the added entry may be of a Tracking state type other than 'Current' (CURRENT). Then the value of the tracking state attribute for the 'Current' type refers unchanged to a tracking state entry other than the one just added. So the tracking state code of these entries may or may not be different. In the use case, the rule is considered 'passed' if the codes differ. Different entries that refer to the same code are not 'reported'.

Configuration:

An event handler that responds to the Added tracking state Triggering events is configured as shown on the right.

IMPORTANT◄ The triggering event refers to the recently added tracking status entry by the variable trackingStatusEntry. The reference object does not play a direct role for the check by the Added-tracking-state-rule.

  • The first instance of the Added-tracking-state-rule is considered 'passed' if the tracking state entry in the trackingStatusEntry variable refers to the tracking state code 'VIRGIN'. This corresponds to the typical use of this rule.

  • The With rule following in the AND junction is used to temporarily assign to the automatically preallocated trackingStatusEntry variable the tracking state entry registered for the present reference object as the current value for the Tracking state type 'Current' (CURRENT). For this purpose, the relevant tracking state attribute is read via a Typed attribute resolver and its value for the trackingStatusEntry field is stored in the trackingStatusEntry variable.

    NOTE◄ The tracking state entry as the return value for the Entity property resolver therefore becomes the alternative reference object for the rule configured within the With rule. However, since the Added-tracking-state-rule only evaluates the trackingStatusEntry variable, this has no effect here.

  • In this temporarily changed calling context, the Added-tracking-state-rule is now executed again within a negation (see Not rule). In doing so, the 'current tracking state' is again compared with the code 'VIRGIN'. In case of any difference, the test is considered 'passed' due to the negation.

  • If the Validating rule is passed overall, a Show alert (Popup) event action alerts the user that the code of the currently assigned tracking state entry differs from the 'current tracking state' of the reference object.

images/download/attachments/201666127/image-2025-3-31_13-18-49-version-1-modificationdate-1743419929850-api-v2.png