Execution Paths

From PresenceWiki
Revision as of 09:51, 14 July 2010 by Admin (Talk | contribs)

Jump to: navigation, search

Execution Paths

A simple Task may consist on one unambiguous serial Execution Path with a defined start and end, as with the following example:

http://www.international-presence.com/wikidocs/images/linear_task.png

This is a very straightforward Task - an SQL Query retrieves customer details, and then an email is sent to each customer. Only one serial Execution Path is required, and the Task's general purpose should be quite self-explanatory.

However, there will be many occasions when it is more intuitive to have multiple sequential Execution Paths. For example, in the above example, as well as sending an email you may wish to collate the results from the SQL Query into a single file which will be faxed to a manager. This could be achieved by placing the additional Nodes after the "Send Email" node, or it could be achieved by adding an extra Execution Path:

http://www.international-presence.com/wikidocs/images/cascading_task.png

When adding one ore more additional Execution Paths, as above, the Task Designer will allocate a number to each Path, starting with 1. This indicates the order in which the Paths will be executed. So in the example above the Task Elements will be executed in the following order:

  • 1) Start of Task
  • 2) Query Customers
  • 3) Send Email
  • 4) Collate Results
  • 5) Fax Manager
  • 6) End of Task

If you wish to change the order that multiple branches are executed, click on one of the paths and use the + / - keys.

End of Task Nodes

If an End of Task Node is present on one branch but not others, that branch will always be executed last - regardless of the specified order of the branches.

Data Handling

In the above example the data retrieved from the "Query Customers" node will be accessible to both Paths because the Query takes place before the Paths diverge. However, let's look at a different example:

http://www.international-presence.com/wikidocs/images/cascading_task_diverging_data.png

As you can see in this example, the paths diverge at the "Passive Node" - before the Query takes place on the first Path. This means that the data retrieved in the first branch will not be visible to the second branch, and neither will any Local variables that have been set.

This is the key difference between "Local" Variables and "Task" Variables. If a Task Variable is set on a diverged branch, its value will still be visible to other branches - this is not the case with Local Variables.

Iterative Execution Paths

An iterative execution path describes an Execution Path which executes repeatedly. This is achieved with the Dataset Splitter and the While Node.