GO

The simplest kind of branch is GO. It appears on AutoStep, ActivityStep and MessageStep. There can be a single GO branch or a list of multiple GO branches. If there is a single GO branch, then you need only specify the To field and any optional Gosu code. The workflow takes this GO branch immediately as it checks its branches.

The Workflows editor indicates a GO branch with an arrow icon superimposed on the line that links the two steps. (That is, the initial From step and the To step to which the workflow goes if the GO condition evaluates to true.)

To access the dialog that defines the GO branch, right-click the starting step—in this case, CheckOnOrder—and select New GO from the menu. (Studio only displays those choices that are appropriate for that step.) This dialog contains the following fields:

Field

Description

Branch ID

ID of the branch to create

From

ID of the step on the which the GO branch starts.

To

ID of the step on the which the GO branch starts.

It is not necessary to enter a branch ID. However, if you create multiple GO branches from a step, then you must enter a unique ID for each branch.

After you create the GO branch, click on the link (line) that runs between the two steps. You will see a dialog that contains the following fields:

Field

Description

Branch ID

Automatically generated.

From

Automatically generated. Workflow step ID of the beginning point of the branch.

To

Workflow step ID of the ending point of the branch.

Arrow Visible

Show an arrow head on the branch line to indicate direction.

Description

Description of this branch.

Condition

Must evaluate to either true or false.

Execution

Gosu code to execute if the workflow takes this branch.

Notice that this branch definition sets a condition. The From and To fields set the end-points for the branch.

If there are multiple GO branches, all the GO branches except one must define a condition that evaluates to either Boolean true or false. The workflow decides which GO branch to take by evaluating the GO branches from top to bottom (within the XML step definition). It selects the first one whose condition evaluates to true. If none of the conditions evaluate to true, then the workflow uses the GO branch that does not have a condition. A list of GO branches is thus like a switch programming block or a series of if...else... statements, with the default case at the bottom of the list.

Infinite Loops

Beware of infinite, immediately-executing cycles in your workflow scripts. For example:

From

To

StepA

StepB

StepB

StepA

If the steps revolve in an infinite loop, PolicyCenter catches this only after 500 steps. This can cause other problems to occur.