Set

Article • 02.08.2022 • 6 minute(s) to read

Set

The Set Activity is used to manipulate Entity and Context Variables. The new variable values set in this Activity can be entered directly, loaded from the database by SQL, taken over from other variables or calculated with Process Context Expressions.

The Set Activity can only operate on Variables that exists when the Set Activity is entered. This means that is not possible to use values set by one configuration in another configuration of the same Set Activity.

This Activity can have an arbitrary amount of Outcomes, but all Outcomes must have the same name. The script of each Outcome is evaluated once the Activity has completed. Each Outcome with a script evaluating to true is followed. If more than one Outcome script evaluates to true, the Instance is paralleled. If no Outcome script evaluates to true, the Instance is ended by entering the closed-state.

Activity config

General
  • Name - Name of the Activity.
  • Version - Version of this Activity used in the Process. If a new version of this Activity is available and you want to use it, you have to manually update the version here. When a new Activity is added to the Process, automatically the latest version is placed.
  • Timeout in second - Once this time is elapsed, the Activity is closed and the Instance changes into the faulted-state. The default Timeout is two minutes. The timeout can be shortened and extended by entering a custom duration. If the Activity is left after a timeout, the first Outcome is followed. If multiple Outcomes have the same name as the first Outcome, all of them are followed. However, a continuation after a timeout does not effect the Outcome Scripts, meaning only Outcomes with Outcome Scripts evaluating to true are followed.
  • Hide in process graph - Controls if the Activity is hidden (Yes) or shown (No) in the Process Graph on the Execution Screen.
  • Continue on error - If this is set to Yes, the execution of the Instance continues even if the Activity failed. If set to No, the Instance fails when the Activity fails by entering the faulted-state. In the case of a continuation after an error, the first Outcome is followed. If multiple Outcomes have the same name as the first Outcome, all of them are followed. However, a continuation after an error does not effect the Outcome Scripts, meaning only Outcomes with Outcome Scripts evaluating to true are followed.
Set

Set Activity specific configurations

GENERAL

General interaction configuration, shared with most other Activities

  • Disable activity - Disables (Yes) or enables (No) the Activity. When disabled, the Activity is not executed and passed like a Connection by following the first Outcome. If multiple Outcomes have the same name as the first Outcome, all of them are followed. Disabling the Activity does not effect the Outcome Scripts, i.e., still only Outcomes with Outcome Scripts evaluating to true are followed.
  • Retry on error - If set to Yes, an automatic retry is executed up to ten times. If set to No, no retries are done. Retries are issued when the Activity failed so that the Instance would enter the faulted-state if the retry is disabled.
  • Additional text for task list - Description of this Activity shown to the Users in their task list. You can enter this text directly or use Process Context Expressions to compile it.
SETTINGS

Configuration specifying the manipulations this Activity does to the Variables. The configured set actions are executed in the order as they are given here:

1. Delete variables
2. Map context to entity variable
3. Use Sql to add or set variables
4. Add or set variables

While it is not possible to access the set values in the same Activity, the order of the configured set actions can be used to overwrite the set values. I.e., the Add or set variables configuration can overwrite values set by the Use Sql configuration, but it cannot read them.

  • Delete variables - This configuration lets you delete one or more Variables from the Process Context. By clicking the Add button, you can add a rows to specify the Variable to be deleted. Each row can be removed again by clicking on . Each variable the be deleted needs to be configured in a separate row.
  • Map context to entity variable - Mappings copy data from Context Variables into an existing Entity Variables. Obviously, the Context Variables must have the same Attributes than the Entity Variables. Only matching Attributes are copied, all others are ignored. The intended use is mostly in conjunction with Forms, where Users enter data but you want to check or modify it before you write the data into the Database. Therefore, you configure the Form to write its data into a Context Variable, do the desired modifications and checks and then use a mapping to write the data into an Entity Variable. By clicking Add, you can add a mapping and specify what should be copied:
  • Add or set variables - This configuration is only shown if Use Sql is set to No. Then you can set the Variables manually or calculate them with Process Context Expressions. With the Add button you can add rows, where each row sets one Attribute of an Entity Variable or a Context Variable:
    • Key - Specifies the name of the Attribute of an Entity Variable or a Context Variable
    • Value - Enter a value directly of calculate it by a Process Context Expression
    • Each definition can be removed by clicking on .
  • Use Sql - When set to Yes, you can use SQL SELECT queries to set the Variables:
    • Sql query - The SQL SELECT query can be entered by clicking Edit. The SQL SELECT query has to deliver one result row. If the SQL result has multiple rows, only the last row is mapped and the previous ones are omitted. The values in the result row’s columns can be copied into the Variables with the Attribute - column map configuration. Parameters are entered with a leading @ and have to be set in the Parameters configuration.
    • Parameters - By clicking Add, you can map a fixed value or the result of a Process Context Expression to the Parameters used in the SQL SELECT query:
      • Key - Name of the parameter used in the SQL SELECT query without the leading @.
      • Value - Value of this parameter. You can enter the value directly or use a Process Context Expression to calculate it.
      • Each mapping can be removed by clicking on .
    • Attribute - column map - Mapping of the SQL result columns to Attributes or Context Variables. Each column has to be mapped individually. By clicking Add, you can create a new mapping:
      • Key - Specifies the target of the mapping. This can be a Context Variable or an Attribute of a Variable.
      • Value - Name of the column in the SQL result, i.e., the source of the mapping.
      • Each mapping can be removed by clicking on .