Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • 5.2 2.3.1.3.2. Snippets
  • 5.2 2.3.1.3.2. Snippets
  • 5.2 2.3.1.3.2. Snippets
  • 5.2 2.3.1.3.2. Snippets
  • 5.2 2.3.1.3.2. Snippets
  • 5.2 2.3.1.3.2. Snippets
  • 5.2 2.3.1.3.2. SnippetsDefault Snippets
  • Create Snippet
  • Open Snippet
  • Save Snippet
  • Rename Snippet
  • Close Snippet
  • Delete Snippet


Default Snippets

By installing Flowster Studio, in Snippets tab there will be deployed the following:

  • Categories:


Templates


This category contains workflow templates and is deployed at Flowster Studio installation.

AD_AddUserToGroup


This snippet adds a specified user to an Active Directory group. 
General knowledge:

...

  • The workflow will finalize with a DisconnectFromAD activity:

AD_ListMembers


This snippet lists all users members of a group in Active Directory. 
General knowledge:

...

  • GroupName is the name attribute of the group in Active Directory. The input value is provided via argument ADGroup_Name <String>.
  • Attributes represent the attributes that will be retrieved for each user member of the group.



The activity outputs the list of users and their selected attributes in Output parameter and stored in variable MembersCollection <Collection<Collection<String>>>. The number of results are returned by Output Rows Count parameter and stored in variable MembersCount<Int32>. 

  • Write activity is used to display at the end of the snippet execution the value stored in MembersCount

...

  • The workflow will finalize with a DisconnectfromAD 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:

...

  • The workflow is starting with a connection to the Citrix XenServer server, by using the ConnectToXenServer activity:


Image RemovedImage Added


Where:

  • Hostname or IP represents the Citrix Xen Server host.
  • Username is the user that will connect to the Citrix XenServer and it can be manually inserted (with the Domain\Username format) or provided via a variable or an IN argument.
  • The Password Binding parameter has no default value because its value must be given encrypted when run outside the Designer (for example Portal).
  • The Password parameter is a Password editor type. When clicked, the Password editor opens and the user may specify the desired password.

...

  • After the connection is made, the CreateVMFromTemplate activity will be used to deploy a new virtual machine with a specified name from an existing template:

Image RemovedImage AddedImage Removed

Image Added


Where:

  • VM Name is the name of the new virtual machine. The input value is provided via argument VMName <String>.
  • VM Template is the name of the existing template. The input value is provided via argument VMTemplate<String>.
  • Start VM automatically is a drop down with default value Yes.

Image RemovedImage Added

The activity outputs the UUID of the new virtual machine in variable NewVm_UUID<String>.

  • Write activity is used to display at the end of the snippet execution the value stored in variable NewVm_UUID:

Image RemovedImage AddedImage Removed

Image Added

Where:

  • Text is the value that will be displayed in Tracking Data.

...

  • The workflow will finalize with a DisconnectFromXenServer activity:

Image RemovedImage AddedImage Removed

Image Added



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

Image RemovedImage Added

  • The workflow is starting with a connection to the VMware vCenter, by using the VMwareConnect activity:

Image RemovedImage Added

Where:

  • Host Name represents the url to access vCenter server.
  • Username is the user that will connect to the VMware vCenter and it can be manually inserted (with the Domain\Username format) or provided via a variable or an IN argument.
  • The Password Binding parameter has no default value because its value must be given encrypted when run outside the Designer (for example Portal).
  • The Password parameter is a Password editor type. When clicked, the Password editor opens and the user may specify the desired password.

...

  • After the connection is made, the VMGet activity will be used to obtain the Template ID:

Image RemovedImage AddedImage Removed

Image Added

Where:

  • Location represents the location of the template in vCenter.
  • VM Name is the name of the template. The input value is provided via argument VMTemplate <String>.

...

  • Template_ID value will be used in the next step, DeployVMfromTemplate:

Image RemovedImage Added

Where:

  • VM represents the template id that will be used to create the new virtual machine.
  • New VM Name represents the name of the new virtual machine. The input value is provided via argument NewVMName <String>

...

  • The final step in the snippet flow is to power on the new created virtual machine using VM Power On activity:

Image RemovedImage AddedImage Removed

Image Added

Where:

  • VirtualMachineID represents the id of the new created virtual machine.

...

  • Write activity is used to display at the end of the snippet execution the value stored in variable NewVm_UUID:

Image RemovedImage AddedImage Removed

Image Added

Where:

  • Text is the value that will be displayed in Tracking Data.

...

  • The workflow will finalize with a VMwareDisconnect activity:

Image RemovedImage AddedImage Removed

Image Added


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

Image RemovedImage Added

  • The workflow is starting with a connection to the HyperV server, by using the HyperVConnect activity: 

Image RemovedImage Added

Where:

  • Hostname or IP represents the HyperV server.
  • Username 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 Password Binding parameter has no default value because its value must be given encrypted when run outside the Designer (for example Portal).
  • The Password parameter is a Password editor type. When clicked, the Password editor opens and the user may specify the desired password.

...

  • After the connection is made, the CreateVMfromTemplateV2 activity will be used to create a new virtual machine from a source template:

Image RemovedImage AddedImage Removed

Image Added


Where:

  • Source Template Name represents the name of the template. The input value is provided via argument SourceTemplate <String>
  • VM Name is the name of the new virtual machine. The input value is provided via argument NewVMName <String>

...

  • The next step is to power on the new created virtual machine using HyperVPowerOn activity:

Image RemovedImage AddedImage Removed

Image Added

Where:

  • VM Name represents the name of the new created virtual machine.

...

  • The workflow will finalize with a HyperVDisconnect activity:

Image RemovedImage AddedImage Removed

Image Added



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

Image RemovedImage Added

  • The workflow is starting with a powershell script code using PSscript activity:

Image RemovedImage AddedImage Removed

Image Added

Where:

  • Script code represents powershell code to be executed by PSscript activity.

Image RemovedImage Added

The output of the activity is stored 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 ForEach activity.

Image RemovedImage Added


The Name property returned by the powershell command is evaluated with a Custom If activity: 

Image RemovedImage Added

In order to extract the Name property from the output returned and convert it to string, an Assign activity is used to store the Name property of the Process in ListProcesses collection: 

Image RemovedImage Added

  • 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 PSscript activity:

Image RemovedImage AddedImage Removed

Image Added


In order to output the values returned by Get CPU info activity, repeat the flow using ForEach activity. 

Image RemovedImage Added


Tutorials

CustomIf_Tutorial


This snippet executes a sequence of actions based on the result of the condition.

  • Custom If activity

Image RemovedImage Added

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

Image RemovedImage Added


  • Custom If – True Sequence

If the condition is true, the workflow will continue executing Condition True branch. 

Image RemovedImage Added

Write activity is used to display the condition result. 

Image RemovedImage Added

  • Custom If – False Sequence

If the condition is false, the workflow will continue executing Condition False branch.

Image RemovedImage Added

Write activity is used to display the condition result. 

Image RemovedImage Added


  • Execution result:

Image RemovedImage Added


StateMachine_Tutorial


Process States

  • Initialization 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 StateMachine Sequence begins with Initialization STATE. The flags used in this workflow to act as triggers are defined with default values as follows: 

Image RemovedImage Added

  • Assign activity is used to log and display a status message stored in variable local_FinalStatusText.

Image RemovedImage Added

The condition to exit Initialization STATE and transition to Input Data Validation STATE must be evaluated by Trigger T1. 

Image RemovedImage Added

If the condition evaluated in trigger T1 is true, the workflow will exit Initialization STATE and transition 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. 

Image RemovedImage Added

If the value provided is negative, the Validation flag will be False: local_ExitFlag_InputDataValidation = 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: 

Image RemovedImage Added

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. 

Image RemovedImage Added

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 local_FinalStatusText. 

Image RemovedImage Added

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:

Image RemovedImage Added


Flowchart_Tutorial


Flowchart activities

  • Flowchart

...

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 value given by variable Value1 is evaluated with the FlowSwitch activity.

  • The workflow will continue its execution following branch Image RemovedImage Added .
  • StringLength activity is used to output the length of variable InputString.

Image RemovedImage Added


  • FlowDecision is used next to evaluate the length of InputString.

Image RemovedImage Added


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

Image RemovedImage Added

  • CollectionOfObjectsFromString  This activity is used to build a collection with elements of type <Object>.

Image RemovedImage Added


Input Parameters: 
InputString<String> 

Image RemovedImage Added


Output Parameters:
Define variable Collection. By default, the variable Type is <String>.

Image RemovedImage Added


Change Type of variable Collection to Collection<Object> . Select Browse for Types… option to open Browse for Types… window.

 Image RemovedImage Added


Search the type of the variable in Type Name field. When finished, click OK.

 Image RemovedImage Added


  • ForEach<Object> - This activity iterates through the elements of the collection using an iterator.

Image RemovedImage Added


For each member in Collection collection, an iteration containing actions is executed.

  • Assign activity is used to increment the value of ForEachStep variable to display at the end of the workflow, the number of iterations.

Image RemovedImage Added


  • Write activity is used to display the members of the collection Collection. The results are displayed at the end of the execution on the same row.

Image RemovedImage Added

  • Message Box activity opens a message box during the execution of the workflow. In order to proceed forward with the execution of the workflow, click OK.

Image RemovedImage AddedImage Removed

Image Added

  • Execution result:

Image RemovedImage Added


Create Snippet

In the main window, click on Snippets tab to open Snippets panel. 

...

To create a new snippet click on Image RemovedImage Added button from Snippets menu. A Save As window will open and the user must specify the name of the new snippet.

...

The final step after editing the snippet is to save it. Click on Close button from the snippet's tab in Workflow Designer.

Image RemovedImage Added


  • A Caution window will open asking the user to save the current snippet.

Image RemovedImage Added

  • Click Yes. A Confirmation window will open with the local path where the snippet has been saved.


Image RemovedImage Added

  • 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 and click on Open button from the Local 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 Save button from the Local Menu.


Rename Snippet

Select a snippet from the snippets list and click on Edit button from the Local 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 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 Close 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 and click on Delete button from the Local Menu or right click to enable the Context Menu and select Delete option.


A Warning window will open. Click Yes.

...