Default Snippets
By installing installing Flowster Studio, in in Snippets tab there tab there will be deployed the following:
- Categories:
Templates
This category contains workflow templates and is deployed at at Flowster Studio installation installation.
AD_AddUserToGroup
This snippet adds a specified user to an Active Directory group.
General knowledge:
- Annotations were used for each activity to explain the behavior of the activity
- The main sequence used for this snippet is Flowchart Sequence.
- The workflow is starting with a connection to the Active Directory server, by using the the ConnectToAD activity activity:
Where:
- ADPath represents represents the LDAP of the Active Directory server.
- Username is is the user that will connect to the Active Directory server and it can be manually inserted (with the the Domain\Username format format) or provided via a variable or an IN argument.
- The The Password Binding parameter parameter has no default value because its value must be given encrypted when run outside the Designer (for example Portal).
- The The Password parameter parameter is a Password editor type. When clicked, the Password editor opens and the user may specify the desired password.
The The output of of the activity will be reflected in the the Connection (ADConn) variable and it will be used for the rest of the Active Directory activities as an input.
- After the connection is made, the the GetEntry activity activity will be used in order to retrieve the entry path of the user that will be added to the group:
Where:
- Value is is the sAMAccountName of the user. The input value is provided via argument argument ADUser_sAMAccount <String>.
The activity activity outputs the the user entry path and is stored in the variable variable UserEntryPath <String>.
- The next step of the workflow is to obtain the group entry path using the same same GetEntry activity activity.
Where:
- Value is is the sAMAccountName of the group. The input value is provided via argument argument ADGroup_sAMAccount <String>.
The activity activity outputs the the group entry path and is stored in the variable variable GroupEntryPath <String>.
- The next step of the workflow is to add the user entry path to the group entry path using using AddUserToGroup activity activity.
Where:
- Group is is the entry path of the group stored in variable variable GroupEntryPath.
- User is is the entry path of the user stored in variable variable UserEntryPath.
- The workflow will finalize with a a DisconnectFromAD activity activity:
AD_ListMembers
This snippet lists all users members of a group in Active Directory.
General knowledge:
- Annotations were used for each activity to explain the behavior of the activity
- The main sequence used for this snippet is Flowchart Sequence
- The workflow is starting with a connection to the Active Directory server, by using the the ConnectToAD activity activity:
Where:
- ADPath represents represents the LDAP of the Active Directory server.
- Username is is the user that will connect to the Active Directory server and it can be manually inserted (with the the Domain\Username format format) or provided via a variable or an IN argument.
- The The Password Binding parameter parameter has no default value because its value must be given encrypted when run outside the Designer (for example Portal).
- The The Password parameter parameter is a Password editor type. When clicked, the Password editor opens and the user may specify the desired password.
The The output of of the activity will be reflected in the the Connection (ADConn) variable and it will be used for the rest of the Active Directory activities as an input.
- After the connection is made, the the GetUsersInGroup activity activity will be used in order to retrieve a list of users members of a group:
Where:
- GroupName is is the name attribute of the group in Active Directory. The input value is provided via argument ADGroup_Name <String>.
- Attributes represent represent the attributes that will be retrieved for each user member of the group.
The activity activity outputs the the list of users and their selected attributes in in Output parameter parameter and stored in variable variable MembersCollection <Collection<Collection<String>>>. The The number of results are returned by by Output Rows Count parameter parameter and stored in variable variable MembersCount<Int32>.
- Write activity activity is used to display at the end of the snippet execution the value stored in in MembersCount
Where:
- InputValue is is the value that will be displayed in Tracking Data.
- The next step of the workflow is to iterate through the the MembersCollection to to display the members returned by by GetUsersInGroup activity activity.
- MembersCollection is is a variable of type type <Collection<Collection<String>>>. In In order to iterate each collection, two ForEach activities are required. The first ForEach activity will iterate through the main collection and it will be of type <Collection<String>>. The second ForEach activity will go through every subcollection of the main collection.
- The Member attributes are displayed on every cycle of the ForEach activity
- The workflow will finalize with a a DisconnectfromAD activity activity:
Citrix_CreateVMfromTemplate_PowerOn
This snippet creates a virtual machine from a template. At the end of the snippet the new virtual machine is powered on.
General knowledge:
- Annotations were used for each activity to explain the behavior of the activity
- The main sequence used for this snippet is Flowchart Sequence.
- The workflow is starting with a connection to the Citrix XenServer server, by using the the ConnectToXenServer activity activity:
Where:
- Hostname or IP represents represents the Citrix Xen Server host.
- Username is is the user that will connect to the Citrix XenServer and it can be manually inserted (with the the Domain\Username format format) or provided via a variable or an IN argument.
- The The Password Binding parameter parameter has no default value because its value must be given encrypted when run outside the Designer (for example Portal).
- The The Password parameter parameter is a Password editor type. When clicked, the Password editor opens and the user may specify the desired password.
The The output of of the activity will be reflected in the the Connection (XenConn) variable and it will be used for the rest of the the Citrix Xen Server activities activities as an input.
- After the connection is made, the CreateVMFromTemplate activity activity will be used to deploy a new virtual machine with a specified name from an existing template:
Where:
- VM Name is is the name of the new virtual machine. The input value is provided via argument VMName <String>.
- VM Template is is the name of the existing template. The input value is provided via argument VMTemplate<String>.
- Start VM automatically is is a drop down with default value Yes.
The activity activity outputs the the UUID of the new virtual machine in variable variable NewVm_UUID<String>.
- Write activity activity is used to display at the end of the snippet execution the value stored in variable variable NewVm_UUID:
Where:
- Text is is the value that will be displayed in Tracking Data.
- The workflow will finalize with a a DisconnectFromXenServer activity activity:
VMware_CreateVMfromTemplate_PowerOn
This snippet creates a virtual machine from a template. At the end of the snippet the new virtual machine is powered on.
General knowledge:
- Annotations were used for each activity to explain the behavior of the activity
- The main sequence used for this snippet is Flowchart Sequence
- The workflow is starting with a connection to the VMware vCenter, by using the VMwareConnect activity:
Where:
- Host Name represents represents the url to access vCenter server.
- Username is is the user that will connect to the VMware vCenter and it can be manually inserted (with the the Domain\Username format format) or provided via a variable or an IN argument.
- The The Password Binding parameter parameter has no default value because its value must be given encrypted when run outside the Designer (for example Portal).
- The The Password parameter parameter is a Password editor type. When clicked, the Password editor opens and the user may specify the desired password.
The The output of of the activity will be reflected in the the Connection (VMConn) variable and it will be used for the rest of the the VMware Server activities activities as an input.
- After the connection is made, the the VMGet activity activity will be used to obtain the Template ID:
Where:
- Location represents represents the location of the template in vCenter.
- VM Name is is the name of the template. The input value is provided via argument VMTemplate <String>.
The activity activity outputs the the id of the input template stored in variable variable Template_ID <String>.
- Template_ID value value will be used in the next step, DeployVMfromTemplate:
Where:
- VM represents represents the template id that will be used to create the new virtual machine.
- New VM Name represents represents the name of the new virtual machine. The input value is provided via argument argument NewVMName <String>
The activity activity outputs the the id of the new created virtual machine stored in variable variable NewVM_ID <String>.
- The final step in the snippet flow is to power on the new created virtual machine using using VM Power On activity activity:
Where:
- VirtualMachineID represents represents the id of the new created virtual machine.
- Write activity activity is used to display at the end of the snippet execution the value stored in variable variable NewVm_UUID:
Where:
- Text is is the value that will be displayed in Tracking Data.
- The workflow will finalize with a a VMwareDisconnect activity activity:
HyperV_CreateVMfromTemplate_PowerOn
This snippet creates a virtual machine from a template. At the end of the snippet the new virtual machine is powered on.
General knowledge:
- Annotations were used for each activity to explain the behavior of the activity
- The main sequence used for this snippet is Flowchart Sequence
- The workflow is starting with a connection to the HyperV server, by using the HyperVConnect activity:
Where:
- Hostname or IP represents represents the HyperV server.
- Username is is the user that will connect to the HyperV server and it can be manually inserted or provided via a variable or an IN argument.
- The The Password Binding parameter parameter has no default value because its value must be given encrypted when run outside the Designer (for example Portal).
- The The Password parameter parameter is a Password editor type. When clicked, the Password editor opens and the user may specify the desired password.
The The output of of the activity will be reflected in the the Connection (HyperV_Conn) variable and it will be used for the rest of the the HyperV Server activities activities as an input.
- After the connection is made, the the CreateVMfromTemplateV2 activity activity will be used to create a new virtual machine from a source template:
Where:
- Source Template Name represents represents the name of the template. The input value is provided via argument argument SourceTemplate <String>
- VM Name is is the name of the new virtual machine. The input value is provided via argument argument NewVMName <String>
The activity activity outputs the the status of the activity.
- The next step is to power on the new created virtual machine using using HyperVPowerOn activity activity:
Where:
- VM Name represents represents the name of the new created virtual machine.
- The workflow will finalize with a a HyperVDisconnect activity activity:
Powershell_GetProcess
This snippet uses powershell scripts to output the result of the Get-Process powershell command.
General knowledge:
- Annotations were used for each activity to explain the behavior of the activity
- The main sequence used for this snippet is Flowchart Sequence
- The workflow is starting with a powershell script code using using PSscript activity activity:
Where:
- Script code represents represents powershell code to be executed by PSscript activity.
The The output of of the activity is stored in in ListProcesses<Collection<PSObjects>>
- The next step is to iterate through the collection of PSObjects in order to display the results of the powershell command using using ForEach activity activity.
The The Name property property returned by the powershell command is evaluated with a Custom If activity:
In order to extract the Name property from the output returned and convert it to string, an Assign activity is used to store the the Name property property of the Process in ListProcesses collectionthe Process in ListProcesses collection:
- The next step of the workflow is to get CPU property for the process with the name equal to the value stored in PSobj variable, using using PSscript activity activity:
In order to output the values returned by Get CPU info activity, repeat the flow using ForEach activity.
Tutorials
CustomIf_Tutorial
This snippet executes a sequence of actions based on the result of the condition.
- Custom If activity activity
- Custom If - Condition
The CustomIf activity is used to evaluate the result of the expression „Value1<Value2". Value1 and Value2 are input variables of type <Int32>.
- Custom If – True Sequence
If the condition is true, the workflow will continue executing executing Condition True branch branch.
Write activity activity is used to display the condition result.
- Custom If – False Sequence
If the condition is false, the workflow will continue executing executing Condition False branch branch.
Write activity activity is used to display the condition result.
- Execution result:
StateMachine_Tutorial
Process States
- Initialization STATE
Local Variables are configured / assigned based on the Input Data.
- Input Data Validation STATE
The Input Values are evaluated; if validation is successful, the process advances to the Execution state, else it advances to the Finalize Process state.
- Execution STATE
In this state, the business logic of the process is implemented. In case of an successful execution, the workflow advances to the Final state.
- Final STATE
Based on the execution of the workflow, the Output Out Arguments are assigned and a workflow Status Email can be sent.
Initialization STATE
The The StateMachine Sequence begins with begins with Initialization STATE. The flags used in this workflow to act as triggers are defined with default values as follows:
- Assign activity activity is used to log and display a status message stored in variable variable local_FinalStatusText.
The condition to exit Initialization STATE and transition to to Input Data Validation STATE must must be evaluated by by Trigger T1.
If the condition evaluated in trigger trigger T1 is is true, the workflow will exit exit Initialization STATE and and transition to to Input Data Validation STATE.
Input Data Validation STATE
In this state the values provided for Value1 input argument is evaluated depending on the results, the workflow will continue to the next state or it will exit.
If the value provided is negative, the Validation flag will be False: local local_ExitFlag_InputDataValidation = False False
Another If activity will evaluate the flag value and if the conditions for the exit triggers will be met, the workflow will proceed to the Final state:
Exit criteria:
local_State_Execution = True - will activate the Execution STATE trigger, that will move to the Execution state.
local_State_Finalize = True – will activate the Final STATE trigger and the workflow will go to the Final state.
Execution STATE
At this state the workflow will increment the value of Value1 argument and compare the incremented value with the value 1. If the condition is met, the workflow will exit Execution STATE and transit to Final STATE.
Exit criteria:
local_State_Finalize = True – will activate the Final STATE trigger and the workflow will go to the Final state.
Final STATE
The final state of the workflow displays the status message on the Tracking Data panel. The message status is stored in variable variable local_FinalStatusText.
In StateMachine sequences, a state of type final does not have an Exit criteria because it does not transition to any other state.
- Execution result:
Flowchart_Tutorial
Flowchart activities
- Flowchart
This activity represents the parent activity for all flowchart specific activities.
- FlowDecision
The condition is evaluated and based on result, the flow will enter True or False branch for execution.
- FlowSwitch
The condition is evaluated based on cases. If the input value is equal with the value of the case, the flow will enter that branch for execution.
Flowchart Sequence
This workflow will read an input value and based on that value a case branch will be executed. The The value given by variable Value1 is evaluated with the the FlowSwitch activity activity.
- The workflow will continue its execution following branch branch .
- StringLength activity activity is used to output the length of variable variable InputString.
- FlowDecision is is used next to evaluate the length of of InputString.
ForEach_Tutorial
This snippet executes an iteration through the elements of a collection and outputs the elements of the collection using different display activities.
- ForEach TUTORIAL sequence sequence
- CollectionOfObjectsFromString – This This activity is used to build a collection with elements of type <Object>.
Input Parameters:
InputString<String> InputString<String>
Output Parameters:
Define variable variable Collection. By default, the variable Type is <String>.
Change Type of variable Collection to Collection<Object> . Select Browse for Types… option to open Browse for Types… window.
Search the type of the variable in in Type Name field field. When When finished, click OK.
- ForEach<Object> - This This activity iterates through the elements of the collection using an iterator.
For each member in in Collection collection collection, an iteration containing actions is executed.
- Assign activity activity is used to increment the value of of ForEachStep variable variable to display at the end of the workflow, the number of iterations.
- Write activity activity is used to display the members of the collection collection Collection. The results are displayed at the end of the execution on the same row.
- Message Box activity activity opens a message box during the execution of the workflow. In order to proceed forward with the execution of the workflow, click OK.
- Execution result:
Create Snippet
In the main window, click on Snippets tab to open Snippets panel.
To create a new snippet click on on button button from Snippets menu. A A Save As window window will open and the user must specify the name of the new snippet.
When finished, click click Save. The snippet will appear in the snippets list under Snippets root folder and a tab with the snippet name will be added to the Workflow Designer panel, for editing.
The final step after editing the snippet is to save it. Click on on Close button button from the snippet's tab in Workflow Designer.
- A Caution window will open asking the user to save the current snippet.
- Click Click Yes. A Confirmation window will open with the local path where the snippet has been saved.
- Click Click OK. The snippet will close in Workflow Designer panel but it will saved in the Snippets list.
Open Snippet
Select a snippet from the snippets list the snippets list and click on on Open button from the Local Menu Menu or right click to enable the Context Menu and select Open option.
The snippet will be opened for editing in Workflow Designer panel.
Save Snippet
Select a snippet from the snippets list and click on on Save button button from the the Local Menu.
Select a snippet from the snippets list the snippets list and click on on Edit button from the Local Menu Menu or right click to enable the Context Menu and select Rename option.
Rename File window opens. Type a new name for the snippet. Click Click Rename.
In Snippets list the display name of the snippet will be changed according to the new name.
Close Snippet
To close a snippet , click on on Close button button from the snippet's Designer tab.
The snippet will be closed. The snippet tab will be removed from the Workflow Designer panel.
Delete Snippet
Select a snippet from the snippets list the snippets list and click on on Delete button from the Local Menu Menu or right click to enable the Context Menu and select Delete option.
A Warning window will open. Click Click Yes.