Control Flow

This page shows how to control the order in which activities are processed by a service.

Request Components

A request component is either an activity, a flow or a sequence.

Flow components contain one or more subcomponents that are processed in parallel. A subcomponent is usually an activity (or more precisely, a string of connected activities) but it can also be another flow or sequence component, i.e. flows can be nested.

Sequence components contain one or more subcomponents that are processed in sequence. A subcomponent can either be a string of connected activities or another flow or sequence component.

Flow control

A flow contains a number of request components which are processed in parallel by the server.

Sequence control

A sequence contains a number of request components which are processed sequentially by the server.

Say you'd like to do the following: Create a new table in a data resource, bulk load some data into the table and then query the data. Obviously, the bulk load cannot start before the table has been created. Likewise, the query should not commence before the data has been loaded into the new table.

You could solve the problem by sending three requests to a service:

  1. Create the new table.
  2. Perform the bulk load.
  3. Query the bulk loaded data in the new table.

This however means that you are sending three requests to the service - three requests go over the network which the associated communications overheads this incurs. It would be nicer if we could specify these activities in a single request:

  1. Create the new table THEN
  2. Perform the bulk load THEN
  3. Query the bulk loaded data in the new table.

while being reassured that the query will not run until the bulk load has finished and that the bulk load won't start until the table has been created. This is where the sequence component comes in - we make our three activities components of a single request and have a guarantee that they will be executed strictly in sequence.

Sequence components are used as follows.