Throttled Parallel For Each

Enumerates the elements of a collection and executes an embedded statement for each element of the collection in parallel up to the Max Concurrent Branches. It is similar with ParallelForEach with the difference that it will execute maximum Max Concurrent Branches branches in parallel. The embedded statements are scheduled together and run asynchronously, but unless the scheduled activities themselves are asynchronous (such as messaging activities, InvokeMethod, or activities that derive from AsyncCodeActivity). They do not run on separate threads, so each successive activity will only execute when the previously scheduled activity completes or goes idle. If none of the child activities of this activity are asynchronous or go idle, this activity execute in the same way that a ForEach activity does.

note

Most of the properties on this activity can be set using an expression. That is why when we set a string value, we must put that string value under "".

ForEach Designer

Designer Properties#

  1. Item The item of the specified Values collection.
  2. Values The activity's collection of inputs for the execution of the Body activity action.
  3. Body The ActivityAction to be executed for each item in the Values collection.
  4. Max Concurrent Branches The maximum number of branches to be used in parallel until we wait for any running branches to complete in order to start a new one(if any).

Properties#

ForEach Properties

General Properties#

See General Properties.

Misc#

  1. Completion Condition Evaluates after any branch completes and completes the activity if it evaluates to true.
  2. Display Name See Misc.
  3. Values The activity's collection of inputs for the execution of the Body activity action.
  4. Max Concurrent Branches The maximum number of branches to be used in parallel until we wait for any running branches to complete in order to start a new one(if any).

Out Error#

See Out Error.

Example#

Start 3 Browser windows

In this example, we start 5 browser windows, but only 3 will run in parallel, navigate to google, type "test" followed by an enter key and when all the browser windows complete their search, we display Done.