Set current working state

Event action – Abstract

Purpose: Attempts to assign a specific Working state as 'Current working state' to the current reference object.

The Set current working state event action attempts to assign a specific Working state to the current reference object as the 'current working state'.

images/download/attachments/73601017/image2021-5-11_10-21-32-version-1-modificationdate-1620721294362-api-v2.png

Values can be assigned to the Reason (reason) and Realization time (realization) for the working state entry created in the event of success.

Success depends on the following factors:

  • The reference object must belong to an entity type that qualifies as a 'working state owner'. (see Working state (Event actions)).

  • For the role claimed in the applicable logon context (see also Ausführen als), the 'working state/create' permission must be guaranteed for the entity type of the reference object.

  • If Working state matrix are applicable to the current context, they must allow switching from the current working state of the reference object to the allowed one selected in the Working state parameter.

Special features for ownership and company authorizations for working state entries

  • If a working state is successfully assigned to a reference object via the Set current working state event action, then the Company of session from the applicable logon context (see also Ausführen als) is considered the owner of the created working state entry by default.

  • Access control via ownership and Company authorizations is only effective for individual working state entries if they are addressed directly, e.g. by a Search. Access rights for the entity registered in the entries as 'working state owner' do not play a role.

  • Based on a specific 'working state owner', on the other hand, access control for individual working state entries on the basis of ownership and Company authorizations does not play a role. As long as access to the 'working state owner' exists and corresponding role rights are available, the 'working state history' therefore always shows all historical entries and therefore a complete status history.

  • For the creation of a working state entry, there is effectively no access control based on ownership or Company authorizations that directly affect the working state for an entity type. Event handling that can identify any entity suitable as a 'working state owner' via the Input object (type safe) value resolver, for example, can always create a working state entry for it via the Set current working state event action. Access rights for the entity are not required for this, nor is a release for creating a working state.

Configuration

The event action must be executed in the context of a suitable reference object ('working state owner').

  • The Working state parameter expects a value of the dynamic enumeration Working state or, alternatively, a string corresponding to the internal name of one of these values. If no value or a text value is specified that cannot be converted to one of the predefined Working state values, an error (including rollback if necessary) occurs at runtime.

  • The optional Reason parameter provides the possibility to define a text value for the corresponding field (reason) in the working state entry to be created. The text value can be supplied either directly (see the screenshot on the right) or as a return value of a value resolver.

  • The Realization time parameter is used to define the time in which the reference object has actually assumed the current working state. If no value is specified here (default), then the current system time of the server is automatically used as the Realization time for the working state entry.

    NOTE◄ The default value ('Now') is assigned to the Realization time taking into account the optional settings for the 'Default time zone' in the company account or user account (if any). Only the original login context is taken into account (Ausführen als has no influence).

images/download/attachments/73601017/image2021-5-11_10-21-32-version-1-modificationdate-1620721294362-api-v2.png

Example

The workflow for Orders imported into Lobster Data Platform / Orchestration via an interface requires that they are transferred from the automatically assigned Working state 'Imported' (IMPORTED) to one of the working states 'Released' (RELEASED) or 'Rejected' (REJECTED) in the course of an incoming inspection, depending on the inspection result. In the input form for the orders to be checked, a button 'Check' is offered, which triggers the following event handling via a Custom action event with the data of the order.

The event handling should request the check result from the user via a User prompt:

  • The standard text 'OK' signals the release of the order.

  • Any other input will be interpreted as a reason for rejection.

  • It should be possible to cancel the check by not entering any text or pressing the 'Cancel' button.

Runtime example:

images/download/attachments/73601017/image2021-5-11_10-22-50-version-1-modificationdate-1620721372400-api-v2.png

Configuration:

An event handling for a Custom action event 'Check' uses a Typprüfung to ensure that the event was triggered in the context of an order. The Actions on passed rule are configured as shown on the right.

Within an If then else event action, the three possible cases for the outcome of an incoming inspection are linked with specific actions for this purpose:

  • In the IF branch (left) within an Entity property rule, the check result is queried by User prompt, which returns the entered string or 'no value'. The comparison type Is empty covers the cancellation scenarios with the 'Cancel' (no value) or 'Clear' & 'OK' (empty string) button in equal measure. In this case, nothing should happen, so the action block below remains empty. The return value is written to the variable input by concatenation with the Store value as variable resolver, so that the user's input (if any) is available for the other branches and their actions.

  • In the ELSE-IF branch (center), whether the variable input has the value 'OK' (case-sensitive) is checked. In the simplest case, the user has confirmed this value previously entered in the User prompt by clicking the 'OK' button. If the entry is 'OK', the event action Set current working state is triggered for the Working state 'Release'. The Reason is assigned as the result of a Concat strings that references the ID of the logged-in user (via User of session; collapsed in the image) as the author of the release.

  • The ELSE branch (right) deals with the case where the variable input is not empty, but contains a text other than 'OK'. This is interpreted as a reason for rejecting the order. A Set current working state event action is then also executed, which assigns the Working state 'Rejected' and notes the text from the input variable as the Reason.

NOTE◄ In both cases, the explicit assignment of a Realization time is omitted, so that the generated working state entry is 'updated' at the time of execution.

images/download/attachments/73601017/image2021-5-11_10-24-11-version-1-modificationdate-1620721452834-api-v2.png