User Guide > Objects > Alphabetical Listing > IF Workflows

IF Workflows

The object-specific Logic tab is only available in IF- and FOREACH-type workflows and its structure depends on the particular workflow type. It can be used to define workflows and the dependencies and properties of their subordinate tasks. The following description explains the Logic tab's specific structure in IF-type workflows and other specific characteristics of IF workflows.

You determine the workflow type when you create the object.

The Logic tab is similar to the Workflow tab which is only available in standard-type workflows. All other tabs are the same for all workflow types.

The tasks of IF workflows have the same properties as the tasks of standard workflows. For a more detailed description, see Object Properties.

For information on how to change this tab's view, refer to the description of the Workflow tab.

General Information

IF workflows process various tasks depending on the conditions that you have specified. The START object includes the conditions that are defined in its properties. After the START box, you see two parallel branches in which you can add any executable objects of your choice. These branches are referred to as a True and False branches. It depends on the condition(s) that should be fulfilled whether the True or the False branch will be processed. Both branches lead to the END object.

The Logic tab's structure is predetermined and cannot be changed. This means that objects can only be added to the True and Else lines and are arranged in series. You cannot create new branches or draw individual lines. For this purpose and if you need more complex structures, you can use sub-workflows.

IF workflows can include any executable object except for schedules and cockpits and they can also include other IF workflows.

You cannot use external dependencies within IF workflows.

The tasks of the branch that should run (True or False) will only be activated and processed when the conditions have been evaluated. The tasks of the other branch are not processed. They appear in white and obtain the status UNPROCESSED within the workflow. No activities are created and no RunID is assigned to the tasks that are not processed.


Defining IF Workflows

Defining Conditions

To define one or several conditions for an IF workflow, open the START object's properties and switch to the Condition tab. This is a specific tab which is only available in the START object of IF workflows.

You can open the properties either using the context menu or via the  symbol within the box.

The Earliest tabs in the START object and in the properties of all workflow tasks are the same.

The Condition tab can be used to determine the IF workflow's branch (True or False) that should run plus the time at which it should run.

You can define various conditions and actions in this tab. They will be processed when the workflow starts before the subordinate tasks are processed. Conditions and actions can be inserted in other condition blocks which allows any nesting depth of your choice.

The Condition tab is similar to the Preconditions and Postconditions tabs which are available in the properties of all workflow tasks. Different are the conditions, actions, the result and the affected tasks.

To create an action or a condition, select it in the right window section and drag and drop it to the left section. A dialog appears in which you can determine the relevant parameters and accordingly, the behavior or the action or condition. Some of the parameters are required whereas others are optional. You can also change them subsequently, just by clicking them.

The final action RUN PATH ends the evaluation process and starts the True or False branch depending on what you have specified.

Note that the workflow will abort if the Condition tab does not include a final action.

You can even define actions that are not included in a condition which means that they will always be processed.

This tab's execution process and the result are logged in the workflow's activation report.

Actions

Name of the action Description Parameters Final action
CANCEL PROCESS FLOW Cancels the workflow.

-) 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 workflow tasks?
Possible values: Including or Excluding

Yes
CLEAR VARIABLE Deletes the entry of a static Variable object

-) The name of the Variable object

-) Key
If the Key starts with a & character, you must use this character twice.

No
EXECUTE OBJECT

Starts any object without checking its status.

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

-) Object name

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

Maximum length: 200 characters
Allowed characters: A-Z, 0-9, $, @, _, -, ..

-) Parameter... (optional)
Opens a dialog in which you can change the PromptSet values of the object that should start. This dialog is only available if at least one PromptSet object is assigned to the object.

-) Wait for the task's end?

The workflow task's variables are always passed on to the started object.

No
RUN PATH

Starts the tasks of the True or False branch.

Ends the evaluation process of this tab's conditions and actions immediately and skips the tasks of the other branch.

This action is only available in the properties of IF workflow START objects.

-) True / False
The specification of the branch that should be processed.

-) Alias
The name that represents the True branch in the Workflow tab. You can use any value of your choice.

Yes
SET VALUE

Defines an object variable or assigns a value to it.

To use this object variable, you must have activated the option Generate at runtime (Post Process is exempted) regardless of the settings that are defined in the parameter scope of the task or the workflow.
Otherwise, the system tries to access a non-existing variable or returns the old value (if the variable is already defined in the object).

-) Variable name
Indicate the variable name without a leading & character. The "Preconditions" report displays this name without a & character but in the object, it is accessed with an & character.

-) Value (optional)

-) Scope: task or 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 starts with an & character, you must use this character twice.

-) Column
Possible values: 0 to 5
0 enters the specified value in the value column 1 and the other columns are reset.

-) Value

No

Conditions

Name of the condition Description Parameters
CHECK ACTIVITIES Checks how often a task is available in the Activity Window with a particular status or status area.

-) Alias or object name.

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

-) Number of object executions

-) Status
Only the states in which the task has not yet ended or aborted (such as active, blocking, waiting and stop conditions.

  • 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 Queue 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

-) 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 if a particular file exists.

-) Agent
If *OWN is specified, the task's agent is used (in file transfers, this is the source agent). This setting is only available for jobs and file transfers.

Note that only the OS agent can check the file. An error occurs if the task is an SAP job and you select *OWN for the agent.


-) Path and file name

-) "Exists" or "Does not exist"

CHECK HISTORY

Checks if an object ended with a particular status in a particular time span.
Specify the time span in days, hours and minutes. It ranges from the current time to the past.

This condition cannot be used for the statistics of a previous Automation Engine version.

-) Alias or object name.

-) Status

-) Days

-) 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

-) 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 TIME Checks if a particular time takes place before or after the current (physical) time, converted to the TimeZone that was used to start this task.

-) "Before" or "After"

-) Reference time 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 they are accessed will be resolved. Variables can be used for system, object and Variable object values.

Adding Tasks

To add a task to an IF workflow, drag and drop one or several objects from the Explorer to the relevant branch of the open IF workflow (True or False).

Note that you cannot link tasks manually. Tasks will automatically be linked to each other when they are added. Therefore, the Line Tool is not available in the Logic tab.

Deleting Tasks

Select the task that should be deleted in the True or Else branch and either open the context-menu command Remove or hit the DEL key.

Note that the lines in IF workflows are predetermined and cannot be deleted.

Moving Tasks

You can change the order in which the tasks are arranged as you like. You can even move tasks to another branch.

Note that the tasks that are included in a branch can only be arranged in a serial order.


Processing IF Workflows

Modifying Active IF Workflows

The rules of modifying active workflows also apply to IF- and FOREACH-type workflows with the following limitations:

Forecast

For forecast calculations, the system uses the branch with the longer total processing duration.

Restart

In restarts, the system reevaluates the START object's conditions and actions. Therefore, it can also happen that the other task branch will be processed depending on the conditions and circumstances that apply. In other words, a restart shows the same behavior as a regular start.