Status: Draft

Advanced Workflow Patterns: Loops, Switch, Reuse Steps, and More

Patterns at Flowchart Level

These videos describe the way to implement the following design patterns at flowchart level:


Design an Asynchronous Loop

Use this pattern if you need to loop on a asynchronous sequence which includes navigating between pages.

This video describes how to design this pattern in the following use case:

  • Navigate between a page containing a list of contacts, and a page that displays the details of one contact.
  • Collect in the context the details of all of the contacts in the list.

It shows you:

  • How to use the 'Start Loop', 'Loop' and 'Exit Loop' activities
  • How the Loop counter is automatically used with multiple items and indexed context items or folders
  • How the design is verified at build time, and how errors are displayed
  • How the corresponding code is implemented

Watch the video here


Design Branches for Decision Making

This video describes two types of branching patterns:

Switch Output

Use this pattern to implement use cases containing a predictable branch in the workflow, depending on a decision made by the script.

This video describes how to design this pattern in the following use case:

  • You have to update the data of a contact:
    • Search for the contact in a page containing the list of existing contacts
    • If the contact exists, click on the Update button and navigate to the Update page
    • If not, click on the New button and navigate to the New page

It shows you:

  • How to use the “Switch Output” activity to set branches in the flowchart design
  • How to set the output value of each branch
  • How to set the output value that will be given as input to the 'Switch Output' activity
  • How the corresponding code is implemented

Watch the video here


Wait multiple

Use this pattern to implement use cases containing a unpredictable branch in the workflow.

This video describes how to design this pattern in the following use case:

  • Start monitoring an application by navigating to the Home Page
  • If the user is still logged in, you normally navigate to the Home Page
  • If login time has expired, the Login page is displayed and you have to login before navigating to the Home Page

It shows you:

  • How to use the “Wait multiple” activity to set a branch in the flowchart design
  • How the corresponding code is implemented

Watch the video here


Reuse Steps

Use this pattern if you want to reuse a step that you have implemented in another workflow (or in the same workflow).

For example, you can have multiple workflows that include the same page on which you have to perform the same actions.

Instead of designing the same sequence of actions each time, you can simply design it once in one workflow
, and reuse the sequence in other workflows.

Watch the video here


Implement an 'Out of scenario' Sequence

Use this pattern if you want to implement a sequence executed out of a scenario.

This video describes how to design this pattern in the following use case:

  • Implement a simple Single Sign On (SSO) feature:
    • Each time the Login page appears, enter the login and password and click the Login button
    • This sequence must be executed at any time, so it must be implemented 'out of scenario'.

It shows you:

  • How to design the sequence in the flowchart design
  • How to set the design 'out of scenario'
  • How the corresponding code is implemented

Watch the video here


Patterns at the Page level

This section describes the way to implement the following design patterns at the Page level:

  • Wait until an Item exists
  • Parallel wait for different events
  • If / Else pattern
  • Synchronous Loop

It also explains how to display generated code for learning Javascript syntax.