Precondition and Postcondition Tabs

You can define Preconditions and Postconditions (including actions and final actions) for each task that is inserted in a Workflow. They are processed when the workflow task runs.

Preconditions and Postconditions are available in the properties of every task in a Workflow. The conditions and actions that are defined in the Preconditions tab will be processed before the task runs. The ones that are defined in the Postconditions will be processed afterward.

Important! Preconditions in a Workflow can only use variables that are available to the task, even if the precondition is part of the Workflow. If the task does not inherit the object values from its parent, they cannot be used in conditions.

A condition verifies something and an action either carries out a regular or a final action. The difference of these two types is that after a final action, neither further conditions will be evaluated nor actions taken.

Conditions can include other conditions and actions. The nesting depth is not limited.

Note: If you have defined Preconditions make sure that they include at least a final action. Otherwise, the task or Workflow cannot start.

This page includes the following:

Important! See also List of Statements to Build Conditions in the Reference Guide.

Accessing the Conditions Editor

  1. In the Workflow editor, right-click the task and select Properties.
  2. Select the conditions tab you need.

    If you have not defined conditions yet, a text indicates it and the button Add Precondition/Postcondition is displayed.

  3. Do one of the following:

    • To create the first condition, click the Add Precondition/Postcondition button.
    • To edit an existing condition or to add further ones, click the pencil icon.
  4. The conditions editor is displayed.

The Conditions Editor

You build the logic of your conditions on the conditions editor.

Dialog Header

Displays the name, title (if specified) and path (where it is stored in the Process Assembly perspective) of the Workflow.

Click the icon on the upper right corner to expand the dialog to the complete window size. Click it again to restore it to its original size.

Commands (Left) Pane

Contains three tabs where you can select the conditions, actions and final actions.

The contents of the tabs vary depending on whether you are inserting Preconditions or Postconditions. They are predefined and you cannot change or edit them

Building (Right) Pane

Drag the commands in the left pane to drop them here.

The symbol indicates that the condition or action is processed recurrently. In case of Preconditions, they are repeated until a final action has been reached. For Postconditions, they are processed only once.

If you want the condition or action to be processed only once, click it. It changes to display a 1. This affects to both the current conditions and all its embedded conditions.

ForEach workflows: Whether your Preconditions will be evaluated once or repeatedly for each iteration (loop) depends on what you define here for each task that is part of the relevant workflow.

Structure of Conditions and Actions

Conditions and actions are displayed on the building pane as blocks that group related statements together to form the entire condition. You can embed conditions within conditions, which are also displayed as blocks within blocks.

A condition block starts with IF. You can add multiple conditions that need to be evaluated together. The additional conditions appear in blocks that start with AND IF.

If for some reason the connection cannot be evaluated, it is neither True nor False. In this case, the system keeps evaluating until it gets a result.

Example

IF file '/uc4/temp1/temp2' exists (check via MUNTEST000594_WO122_LX6_01_SYS and use log in LOGIN.OBP.0001).
FINALLY run task
ELSE FINALLY skip

In this example, the system keeps evaluating until it finds the relevant path. If the file exists, the condition ends with True; otherwise it ends with False.

The first action block of a block starts with THEN, blocks for additional actions for a positive evaluation of a condition begin with AND THEN.

Blocks for the action for a negative evaluation of the condition start with ELSE. Additional ELSE actions start with AND. This allows you to build further AND IF conditions for an ELSE action, to describe another decision branch for an action.

Working with the Conditions Editor

To Add Conditions and Actions

  1. Select a condition or action from the left pane.
  2. Drag and drop it onto the right pane. It is displayed in a block.

    The parameters that you have to populate with the data to be evaluated by the condition are highlighted and in capital letters. See To Populate Conditions or Actions .

To Insert Conditions and Actions in Other Conditions

  1. Select a condition or action from the left pane and drag it to the right pane.
  2. Move it across the pane until the block in which you want to include it displays a highlighted line (the color depends on your configuration).

  3. The embedded condition or action is displayed in a block of its own within the "parent" condition.

To Replace Conditions and Actions

  1. Select a condition or action from the left pane and drag it to the right pane.
  2. Move it across the pane until the condition or action you want to replace is highlighted and REPLACE is displayed over it.

To Deactivate or Remove Existing Condition or Action Blocks

Select the required block and click the Deactivateor Remove button in the upper right corner of the dialog.

Deactivating has the effect that the block will not be processed during the Workflow execution. Deactivated blocks are grayed out. You can activate them again at any time.

To Populate Conditions or Actions

Once you have inserted a condition or action you have to populate it with the values that are going to be evaluated. They are the highlighted terms on the condition editor header. For example, in the screenshot below these are VALUE1, OPERATOR and VALUE2.

Screenshot of the conditions dialog.

  1. Click any of the values on the header. This expands the block and displays the input or selection fields.
  2. You can populate them using either variables or a static value that you enter or select.

    To use variables:

    1. Either hover your mouse over its label or insert your cursor in the corresponding field. This activates the # button that indicates the possibility of using variables.
    2. Click it. The field displays now the variable picker icon:

    3. Click it to open the Insert Variable dialog. For details on how to insert variables see Inserting Variables in Objects and Scripts.
    4. If all fields are populated and the values are correct, the block is closed and the values are displayed on its header.
    5. When you are done, click OK to close the dialog.
    6. Save your changes.

To Copy and Paste Pre and Post Conditions

You can reuse already defined conditions by copying and pasting them both in a different task either within the same Workflow or in an entirely different one. If the copied condition includes nested conditions, they are also copied.

An internal check ensures that you can only paste a condition that is valid in the context of the target task. If it is not, the Paste button is disabled.

  1. Select the condition you want to copy and click Copy on the toolbar.
  2. Click OK at the bottom of the editor to leave it.
  3. Switch to the task into which you want to paste the condition and open the conditions editor there.
  4. Do one of the following:

    • Click Paste on the toolbar or select it in the dropdown menu.
    • If you want to insert it in an already existing condition, select it and click Paste.
  5. Click OK to leave the editor.
  6. Save your changes.

See also: