show / hide menu

Demo project using Workflow Activities

The URL of the demo project is given below where users can learn about these activities in a better manner.

Steps:

1st Sequence: Sum of two variables. 

  1. create two separate variables of integer data type. 
  2. Use multiple assign activity to assign separate values to each variable created in the first step. 
  3. Drag and drop an assign activity. In the ‘To’ field create a new variable of integer type which will represent the sum of other two integer variable. In the “value” field, provide the 1st and 2nd variable name with “+” in between.  
  4. Use a message box to display the result of the new variable. 

2nd sequence: ForEach Activity 

  1. Create a variable of array list data type and add five elements in the Default Value. (e.g. [“A”, “B”, “C”, “D”, “E”]) 
  2. Drag and drop the ForEach activity. In the ‘Condition’ field add the variable that was created in the first step. 
  3. Use a message box to display each element. To see each element, add the ‘Output’ variable (varItem) of ForEach activity in the ‘Input’ field of the message box. 

3rd Sequence: Break Activity 

  1. Inside the For Each, use a decision activity. In the ‘Condition’ field add a condition to check if a particular element exists.  
  2. If the element exists, use the “break” activity to exit the ForEach activity. 
  3. Use a message box to display elements. 

4th Sequence: Replace “break” with “continue” 

  1. Remove the “break” activity under the decision activity and drag and drop “continue” activity. 
  2. Save the changes and click on the “Play” button. The element specified in the condition field will be skipped, and the process will proceed to the next one. 
  3. Use a message box to display elements. 

5th  Sequence: Create a new sequence

  1. Drag and drop Assign activity. In the ‘To’ field create a new variable called varCounter of integer type, in the ‘Value’ field add value as 1. 
  2. Use the loop activity and give a condition such that as long as varCounter is less than or equal to 5, it will display the value of varCounter. 
  3. Use a message box to display the value. 
  4. Drag and drop another Assign activity to Increment the value of varCounter by 1 in each iteration. In the ‘To’ field add varCounter and in the ‘value’ field add varCounter+1. 

6th Sequence: Throw Error and Retry Sequence activity

  1. Drag and drop the “Throw Error” activity below outside the loop activity in the 5th sequence.  
  2. In the ‘Message’ field write “Retrying the Sequence”. 
  3. Under the On Error block, drag and drop “Retry the Sequence”. In the ‘No. of retries’ field you can give any number (In the video its 2). It will retry the sequence after handling the error. 

7th Sequence: Invoke Sequence  

  1. Use the “Invoke Sequence” activity in the main sequence (4th Sequence) to integrate with the 5th  Sequences. 
  2. Below the Invoke Sequence, use a Write Line activity to confirm the process completion. 

Activities Used“Multiple Assign, Assign, Message Box, For Each, Break, Continue, Loop, Decision, Throw Error, Retry the Sequence, Invoke Sequence, Write Line”
Video Link https://www.youtube.com/watch?v=tt8DURwe_x0&list=PLwFA5laAhcEJ7sVztHRNXDdXffy2odMvv&index=38