Control Flow
Activities
Do While
This activity executes the activity contained in its body at least once, until the specified condition evaluates to false.
Activity Parameters
The Do While activity has only one parameter and it can be provided by manually inserted values or via IN arguments or variables:
Parameters:
- Condition (text box editor type) (type: boolean): the condition that must be met in order to execute the activity in the body of the Do While. It can be either an explicit condition input directly in the Condition field (as seen in the example above), or via a Boolean variable/IN argument.
Example:
The following basic example will remove all instances of an IP (192.168.0.11) from a previously defined collection of IPv4 addresses (where it appears twice):
This time, the condition will be provided via a boolean variable (IPexists), which dictates the Do While activity to loop until the the IP is not found in the collection anymore. It has been initialized to True to make sure it enters the Do While sequence at least once
The two getElementFromCollection activities have been added to the workflow to compare the contents of the Collection before and after the Do While activity run.
Before:
25-01-2016 04:19:06 | getElementFromCollection | Executing |
25-01-2016 04:19:06 | getElementFromCollection | Collection Count: 6 |
25-01-2016 04:19:06 | getElementFromCollection | Element: 192.168.0.10 |
25-01-2016 04:19:06 | getElementFromCollection | CSV String: 192.168.0.10,192.168.0.11,192.168.0.12,192.168.0.13,192.168.0.14,192.168.0.11, |
After:
25-01-2016 04:19:06 | getElementFromCollection | Executing |
25-01-2016 04:19:06 | getElementFromCollection | Collection Count: 4 |
25-01-2016 04:19:06 | getElementFromCollection | Element: 192.168.0.10 |
25-01-2016 04:19:06 | getElementFromCollection | CSV String: 192.168.0.10,192.168.0.12,192.168.0.13,192.168.0.14, |
If
This activity runs an activity/sequence of activities if a condition is true, and can optionally run activities if the condition is false.
Activity Parameters
The If activity properties can be provided via manually inserted values or via IN arguments or variables:
Parameters:
- Condition (text box editor type) (type: boolean): the condition that decides which child activities will be executed
Example:
This basic example will iterate a previously defined collection of IPv4 addresses, and when a specific one is found (validated via an If activity), test its connection.
The IPv4Collection variable definition:
In this example, the Else branch has been left empty, therefore no activity will be performed against the Iterators that do not meet the condition (Iterator="191.168.0.14").
Parallel
This activity that executes all child activities simultaneously and asynchronously. It completes when all its child activities are completed or when the completion condition is met.
Activity Parameters
The Parallel activity properties can be provided via manually inserted values or via IN arguments or variables:
Parameters:
- CompletionCondition (text box editor type) (type: boolean): the optional condition that decides when the parallel activity is completed. If left blank, the activity is marked as completed when all its branches are completed.
Parallel ForEach With Body Factory
This activity iterates a collection of elements of the same type and executes all child activities simultaneously and asynchronously per each element. It completes when all its child activities are completed or when the completion condition is met.
Activity Parameters
The Parallel ForEach With Body Factory activity properties can be provided via manually inserted values or via IN arguments or variables:
Parameters:
- CompletionCondition (text box editor type) (type: boolean): the optional condition that decides when the parallel activity is completed. If left blank, the activity is marked as completed when all its branches are completed.
- TypeArgument (ComboBox type): the type of the elements in the collection/array that the activity will iterate.
- Values (text box editor type) (type: dependant on TypeArgument): the collection/array that the activity will iterate. On each iteration, the body of the ParallelForEachWithBodyFactory activity will be executed.
Sequence
This activity runs a set of child activities based on a single defined ordering.
Activity Parameters
The Sequence activity has no paramaters except the its DisplayName which can be customized for easier usability.
Switch
This activity selects one choice from a number of activities to execute, based on the value of a given expression.
Activity Parameters
The Switch activity has only one parameter and it can be provided by manually inserted values or via IN arguments or variables:
Parameters:
- Expression (text box editor type) (type: depending on the Type that was selected when adding the activity to the workflow): the expression/variable/IN argument that will be evaluated in order to decide which child activity will be executed.
Example:
The following basic example will retrieve the Int32 switchInput IN argument (pictured above) and return whether it's a negative or positive (null included) integer value. Being an IN argument, it will be input in the Flowster Studio Portal.
switchOutput is a string OUT parameter which can be further used in various activities or displayed in Flowster Studio Portal.
While
This activity repeatedly executes a contained activity while a condition evaluates to true. The difference between While and Do While is that the Do While activity first executes the activities and then evaluates the condition, whereas While first evaluates the condition and only runs the child activities if the result is true.
Activity Parameters
The Do While activity has only one parameter and it can be provided by manually inserted values or via IN arguments or variables:
Parameters:
- Condition (text box editor type) (type: boolean): the condition that must be met in order to execute the activity in the body of the Do While. It can be either an explicit condition input directly in the Condition field (as seen in the example above), or via a Boolean variable/IN argument.
Example:
In the following basic example we will revisit the example from the Do While activity and we will remove all instances of an IP (192.168.0.11) from a previously defined collection of IPv4 addresses (where it appears twice) using the While activity:
The condition will be provided via a boolean variable (IPexists), which dictates the Do While activity to loop until the the IP is not found in the collection anymore. It has been initialized to True to make sure it enters the Do While sequence at least once.
The two getElementFromCollection activities have been added to the workflow to compare the contents of the Collection before and after the Do While activity run.
Before:
27-01-2016 05:58:52 | getElementFromCollectionBefore | Executing |
27-01-2016 05:58:52 | getElementFromCollectionBefore | Collection Count: 6 |
27-01-2016 05:58:52 | getElementFromCollectionBefore | Element: 192.168.0.10 |
27-01-2016 05:58:52 | getElementFromCollectionBefore | CSV String: 192.168.0.10,192.168.0.11,192.168.0.12,192.168.0.13,192.168.0.14,192.168.0.11, |
After:
27-01-2016 05:58:52 | getElementFromCollectionAfter | Executing |
27-01-2016 05:58:52 | getElementFromCollectionAfter | Collection Count: 4 |
27-01-2016 05:58:52 | getElementFromCollectionAfter | Element: 192.168.0.10 |
27-01-2016 05:58:52 | getElementFromCollectionAfter | CSV String: 192.168.0.10,192.168.0.12,192.168.0.13,192.168.0.14, |