1. Home
  2. Docs
  3. Workflow
  4. WorkFlow Control
  5. Parallel

Parallel

System.Activities.Statements.Parallel

  • Parallel activity is used to schedule two or more child Sequence activity branches for processing at the same time.
  • Although branch Sequence activities are scheduled to start processing at the same time but they do not start processing at the same time.
  • Processing begins with the execution of one activity that is contained in one of the Sequence activity branches. When that activity is completed, the next activity in sequence in another branch executes, and so on.
  • Activity execution switches between the Sequence branches, with one activity executing at a time until all the Sequence branches finish executing.
  • If a Sequence branch contains an activity such as a blocked Delay activity, execution does not stop and wait for the activity to be unblocked. Instead, the next activity in the next Sequence branch is executed.

Properties

       Misc

  • CompletionCondition (Activity<Boolean>) – If this property evaluates to true, then the other scheduled elements in the Sequence branches are cancelled. If this property is not set, all the activity objects in the Sequence branches collection execute until completion.
  • DisplayName (String) – To set a meaningful name according to the user.

Example

To use Parallel activity, create an automation that opens a website and handles the login pop-up parallelly after clicking on a log in button in the webpage.

  • Create a sequence.
  • Add an Openbrowser activity and type https//www.semrush.com/in the Url field in Properties
  • Add a Parallel
  • Inside the Parallel activity, add two Sequence
  • In the first Sequence, add a Click
  • In the Click activity, click on the Find Element and capture the element of Log in button appeared in the webpage opened above.
  • In the second Sequence, add a Delay activity and type 00:00:10 in the Duration field in the Properties
  • Add a Click activity under the Delay
  • In the Click activity, click on the Find Element and capture element of the cancel sign appeared in the pop-up after manually clicking on the Log in button appeared in the webpage opened above.
  • Run the process and see the working of the parallel activity