Control Flow - NeoSOFT-Technologies/workflow-plugins GitHub Wiki

Description

A control flow defines a workflow of tasks to be executed, often a particular order. Examples of control flow are as;

Break

Breaks the current iteration of a given For, For Each or While activity.

For example, if you have a While activity with a Condition value of true (representing an infinite loop), you can break out of this loop using the Break activity.

Properties This activity has no additional properties other than the shared set of activity properties.

CF_Break

Finish

Signals the workflow runner that the current composite activity should be stopped.

Since workflows are composite activities, this means that when this activity is used within a workflow, the workflow instance will enter the Finished state. When used in a child composite activity, that activity will stop execution and yield back control to its container. However, it will not stop workflow execution itself.

The activity also removes any blocking activities within the scope of the currently executing composite activity including any child scopes.

Properties

Property Description
Activity Output The object to return as output from the currently executing composite activity to the parent composite activity.
Outcome Names Zero or more outcomes to schedule on the parent composite activity.

Outcomes

Outcome Description
Done Always scheduled when the activity completed.
* Any additional outcomes that are configured in the Outcome Names property

CF_Finish

For

Models a looping construct that is similar to C#'s for statement where the loop executes from a starting number to a final number using a given step value.

Properties

Property Description
Start The number to start from when performing the loop.
End The number to stop at when performing the loop.
Step The number to use when incrementing the current value.
Operator The operator to use when comparing the current value against the End value.

Outcomes

Outcome Description
Iterate Scheduled for each iteration of the loop. When an iteration ends, the activity will automatically determine if another iteration should be scheduled.
Done Scheduled when the loop has finished.

CF_For

For Each

Models a looping construct that is similar to C#'s foreach statement where the loop iterates over a collection of objects. When providing an expression using Json or JavaScript, make sure that the expression evaluates to an array.

Properties

Property Description
Items A collection of objects to iterate over.

Outcomes

Outcome Description
Iterate Scheduled for each iteration of the loop. When an iteration ends, the activity will automatically determine if another iteration should be scheduled.
Done Scheduled when the loop has finished.

CF_ForEach

Fork

The Fork activity simply forks workflow execution into multiple branches. When you add this activity, you specify a list of one or more branch names. These branch names will be scheduled as activity outcomes.

For example, if you add a Fork activity with branches Do Some Request and Timeout, the Fork activity will show these branches as outcomes.

When the Fork activity executes, both branches will execute. CF_Fork

If/Else

The If/Else activity evaluates a Boolean expression and continue execution depending on the result.

The If/Else has three branches : True, False and Done. If you have a True outcome, it executes immediately and then the Done branch is executed. But if you have a False outcome, it's waiting on the Done branch before execution.

CF_IfElse

Join

The Join activity merges workflow execution back into a single branch.

The Join activity has a Mode property that can be one of the following values:

  • Wait All : The Wait All mode will cause the workflow to remain at the Join activity until after ALL inbound branches have executed the Join activity.
  • Wait Any : The Wait Any mode on the other hand will continue as soon as ANY inbound branch executes the Join activity.

CF_Join

Parallel For Each

This activity iterates over a collection in parallel.

Switch

The Switch activity evaluates multiple conditions and continue executing depending on the results.

CF_Switch

While

The While activity executes while a given condition is true.

CF_While