User Guide > Objects > Alphabetical Listing > Preconditions Tab

Preconditions Tab

You can use this tab to specify conditions that will be checked before a task runs. If a condition applies, the corresponding actions are processed.

This tab's structure is similar to that of the Postconditions tab which is also available in the workflow properties. However, the available conditions and actions differ from each other, and the Preconditions tab is processed several times before a task starts. The "Postconditions" are processed once after the task has ended.

Defining Conditions and Actions

The Preconditions tab includes two sections:

The right section lists the conditions or actions depending on what has been selected. The left section is empty at the beginning, but you can select and drag conditions and actions of your choice and drop them into this section.

This is done as follows:

You can also create actions without a corresponding condition. In this case, the action is executed with each evaluation process.

You can copy condition and action blocks, including their sub-blocks and all parameters that include values, and insert them in the Postconditions tab. Use the shortcuts CTRL + C and CTRL + V for this purpose.

You can insert any number of conditions and actions within each condition block. The nesting depth depends on your selections.

Each condition and action block requires particular parameters that must be specified (for example, the agent that is used or the status that should be checked). In a block, click the parameter name and enter the required values in the open dialog window.

You can also use predefined variables as parameter values. To open the Variable picker, you click the element name (= blue text left to the element) in the parameter dialog. The relevant input field changes to a gray text field and the button at the lower right edge becomes active. Click it to open the Variable picker dialog.

You can also use object and PromptSet variables within Preconditions. It is important that the variables are available when the conditions or actions are called. When you set the variables in one or several predecessors in the workflow, note the following: 

Note that you should set the value "OWN in the agent conditions only when the agent is not exclusively set via the Pre-Process tab. Otherwise, the workflow task stops with the status "Waiting for Preconditions".

There is a menu for each block that can be opened by clicking the symbol. The following options are available:

Structure of Conditions and Actions

Conditions and actions are structured as blocks and include a descriptive text and the parameters. The parameters including their values appear in blue within the descriptive text.

Parameters are values that manipulate the behavior or the conditions and actions (see the above description).

The descriptive text of conditions and actions starts with a keyword that is written in uppercase letters. The keyword depends on whether it refers to a condition or an action and where it is located.

Keyword Conditions or Action
IF A top-level condition.
AND IF A condition that is located within another condition.
THEN The first action of a block.
AND THEN The subsequent actions.
FINALLY The final action.

The text of actions that are located in an ELSE branch do not start with the keyword THEN.

Final actions appear in green in the selection and the definition areas

Evaluation

The conditions and actions that have been defined in the Preconditions tab are checked and executed when the predecessors have been processed and the earliest start time has been reached. The check (evaluation) is repeated in the time interval that has been defined in the variable UC_SYSTEM_SETTINGS, setting CONDITION_CHECK_INTERVAL. This process ends when a final action or the latest start time has been reached. Only then does the task start. For final actions refer to the table that is shown below.

Note that a task cannot start if the Preconditions tab includes neither a final action nor a latest start time. In this case, the evaluation cycle is repeated an infinite number of times. The tab is skipped if it is empty.

The task also starts if you use the functionality "Once" because in this case no additional conditions and actions are checked or executed.

During the evaluation process, the task obtains the status "Waiting for Preconditions".

The following commands in connection with the Preconditions tab are available in the context menu of the Workflow Monitor and the Activity Window:

Conditions like all other properties can be modified at runtime provided that the task has not yet started.

This tab cannot be modified by using the script element MODIFY_TASK.

The evaluation time is included in the workflow's ERT and not that of the task.

A separate report is created for the Preconditions tab. It includes evaluation information (latest evaluation, evaluation duration etc).

Conditions

Condition Description Parameters
CHECK ACTIVITIES Checks the number of times that a task is shown in the Activity Window with a particular status or status area.

-) The alias or object name

-) Corresponds to "greater", "less", "equal" or "not equal"

-) The number of object executions

-) Status
You can only set states in which the task has not yet ended or aborted (such as active, blocking, waiting and stop conditions). End conditions are not available.

  • ANY_ACTIVE - The task is active.
  • ANY_BLOCKED - The task blocks.
    (System-Rückgabewert: 1560, 1898)
  • ANY_BLOCKED_OR_STOPPED - The task has been stopped or it blocks (system return codes: 1560, 1561, 1562, 1563, 1564, 1898)
  • ANY_RUNNING - The task is active and not in a waiting condition
  • ANY_STOPPED - The task has been stopped (system return codes: 1561, 1562, 1563, 1564)
  • ANY_WAITING - The task is in a waiting condition.
  • WAITING_AGENT - The task is waiting for an agent (system return code: 1696)
  • WAITING_AGENT_OR_AGENTGROUP - The task is waiting for an agent or an agent of an agent group (system return codes: 1686, 1687, 1688, 1696)
  • WAITING_AGENTGROUP - The task is waiting for an agent of an agent group (system return codes: 1686, 1687, 1688)
  • WAITING_EXTERNAL - The task is waiting for an external dependency (system return code: 1690)
  • WAITING_GROUP - The task is waiting for a group to start (system return code: 1710)
  • WAITING_QUEUE - The task is waiting for a Queu e object (system return code: 1684)
  • WAITING_SYNC - The task is in a waiting condition because of Sync conditions (system return code: 1697)
CHECK CONNECTION

Checks whether a certain agent is available.

In SAP and databaseA database is an organized collection of data including relevant data structures. agents you can also define a Connection object.

This condition has the same function as the script element SYS_HOST_ALIVE.

-) Agent

The number of agents is limited by the SQLVAR_MAX_ROWS setting defined in the UC_SYSTEM_SETTINGS - System-Wide Settings variable.

-) Connection object (optional)

Note that you must select the empty value in the combo box when you do not want to define a Connection object. The default value <CONNECTION> is not valid.

CHECK FILE Checks whether a particular file exists.

-) Agent
The value *OWN indicates that the task's agent is used (the source agent in file transfers). Only supported in jobs and file transfers.

Attention: Only the OS agent can make a file check. An error will occur if the task is a SAP job and you select *OWN for the agent.

The number of agents is limited by the SQLVAR_MAX_ROWS setting defined in the UC_SYSTEM_SETTINGS - System-Wide Settings variable.

-) Path and file name

-) "Exists" or "Does not exist"

CHECK HISTORY

Checks whether an object ended with a particular status in a particular time span.
The time span must be specified in days, hours and minutes. It ranges from the current time to the past.

This action cannot be used in the statistics of previous Automation Engine versions.

-) Alias or object name

-) Status

-) Days

-) The time in the format HH:MM

CHECK PROCESS

Checks whether a particular process runs on a computer.

This is only possible with Windows and UNIX platforms.

-) Process: PID (process ID) or the name of the process.
You can also specify a part of the process name with or without wildcard characters (*). The system searches within the process name even if you do not use a wildcard character within a string.

-) Status
"running" or "not running"

-) Agent
UNIX or Windows agent

The number of agents is limited by the SQLVAR_MAX_ROWS setting defined in the UC_SYSTEM_SETTINGS - System-Wide Settings variable.

-) Login object

The value *OWN for the agent or the Login object indicates that the task's attributes are used (only supported in file transfers and jobs). In file transfers, the source's values are retrieved.

CURRENT QUEUE Checks the queue in which the task runs. -) The name of the Queue object
CURRENT TIME Checks whether a certain point in time lies before or after the current (physical) point in time (converted to the TimeZone that has been used to start this task).

-) "Before" or "After"

-) Reference time in the format HH:MM

TIME SINCE ACTIVATION Checks the time that has past since the task has been activated.

-) "Less than" or "More than"

-) Duration in the format HH:MM

USER DEFINED Compares two values of your choice with each other.

-) Value 1 (script literal, predefined variables)

-) Operator: '>', '>=', '=', '<','<=' or '<>'

-) Value 2 (script literal, predefined variables)

Only the predefined variables whose values are available at the time that they are accessed are resolved. Variables can be used for system, object and Variable object values.

Actions

Action Description Parameters Final action
BLOCK Sets task to a blocked status.

-) The task's status text (optional).

The status text is truncated in the Detail Window if this parameter exceeds the maximum number of 32 characters. The report displays the text in its full length.

Yes
CANCEL PROCESS FLOW

Cancels the workflow. This action is similar to the CANCEL_UC_OBJECT script function. When this action is taken, the worflow is terminated immediately and no new tasks within it are started.

-) The workflow that should be canceled. Possible values "*OWN", "Top" or "Parent."

*OWN - Workflow in which the task runs.
Parent - Superordinate workflow of *OWN.
Top - Top workflow.

-) Also cancel the workflow's tasks?
Possible values "including" or "excluding"

Yes
CHANGE QUEUE Changes the task's queue. -) The name of the Queue object. No
CLEAR VARIABLE Deletes the entry of a static Variable object.

-) The name of the Variable object.

-) Key
If the Key begins with the & character, use this character twice.

No
EXECUTE OBJECT

Starts any object and does not check its status.

The UC_CAUSE - ReadBuffers include values and can be read in this object's script.

-) The object name

-) Alias (optional)
The name to be used for the task that should start instead of the object name in the Activity Window and the statistics.

-) Parameter... (optional)
Opens a dialog in which you can modify the PromptSet values of the object that should start. Can only be called if at least one PromptSet object has been assigned to the object.

-) Wait until this task ends?

The started object always inherits all variables of the workflow task.

No
PUBLISH VALUE

Publishes a value via an object variable. The specified object variable is created if it does not yet exist. Otherwise, a value is assigned to it. Then the value provided to the subsequent tasks.

This action has the same function as the SET VALUE action. The only difference is that the object variable is always passed on to the workflow.

-) Value

-) The variable name

The variable name must be specified without a leading & character. In the "Postconditions" report it is also written in the same way. In the object, it will be accessed with an & character.

No
RE-EVALUATE AT Restarts the evaluation process at a particular point in time. -) The point in time in the format +TT/HH:MM. Yes
RE-EVALUATE IN Processes the evaluation cycle after a particular period from the beginning. -) The time in minutes Yes
RUN TASK Starts the task and does not check any other conditions.   Yes
SET VALUE

Defines or assigns values to an object variable.

The setting "Generate at runtime" must be activated in the particular object in order to use this object variable (except for Post Process) regardless of the parameter Scope (task or workflow). Otherwise, the system tries to access a variable that does not exist or returns the old value (if the variable is already defined in the object). 

-) The variable name
Specify the variable name without a leading &. The "Preconditions" report also shows the name without &. If it is accessed in the object, the & character is used.

-) Value (optional)

-) Does it affect the task or the workflow?

No
SET VARIABLE Enters the value in a static Variable object. Existing values are overwritten. 

-) The name of the Variable object

-) Key

If the Key begins with the & character, use this character twice.

-) Column
Possible values: 0 to 5
"0" indicates that the specified value is written to value column 1 and all other columns are reset.

-) Value

No
SKIP TASK

Skips the task. If a task is skipped in a Precondition, no more Pre-Conditions are run and all Post-Conditions are not run. The final unaltered status of the task will be:

1933 - "ENDED_SKIPPED - Skipped because of conditions."

-) The task's status text (optional)

The status text is truncated in the Detail Window if this parameter exceeds the maximum number of 32 characters. The report displays the text in its full length.

Yes