Skip to main content
Kinetic Community

Loops and Joins

Using Loops and Joins in the Task Builder

Tree Configuration

Loop Begin and Loop End – The two tasks that make up the loop system controls, must be used together. You are able to put any other type of task in the loop. The Loop End node on your task tree controls how many times the loop processes. The Loop Begin node controls how many instances of the loop are created when the loop is encountered on the task tree.

LoopTaskTree.jpg

Notice that the Loop Begin node has a connector to its Loop End node. This connector closes the loop and identifies the actions that are part of the loop.

Loop End nodes have the following options; All, Some, or Any.

LoopEndDialog.jpg

  • All requires each instance of the loop to be complete
  • Some requires a number (input into a separate field) of loop instances to complete
  • Any will continue the loop as soon as any of the loop instances is complete.

Loop Begin nodes have the following fields:

 

Data Source holds an XML string that defines how many instances of the loop are created.

Loop Path is the XPath definition to the particular data for the loop.

Variable Name is a name that can be used in other nodes in the loop to reference the data defined by the Loop Path

All three fields are required.

Example: You want to send a request to a group of approvers. Only 2 of the approvers need to approve for the request to create a ticket. The list of approvers is created by a previous task and placed into the Data Source field. Here is a sample list (approvers email addresses):

<appEmail>

  <email>Bob@acme.com</email>

  <email>Jane@acme.com</email>

  <email>Charles@acme.com</email>

</appEmail>

Each element in a list becomes a trigger. Multiple engines will work against the trigger list.

*** Tip: Potential for high server load ***

Here is the Loop Path to identify the names:

//appEmail/email

The Variable Name can be any text that identifies value defined by the XPath. Example: appEmail or approver_email. This value is used with the following syntax in the nodes within the loop - @appEmail or @approver_email depending on what you put into the Variable Name.

One limitation to naming your Variable Name – it cannot be the same as the tag used in the Data Source field. For example, we used <email> as the tag in our example above, so you cannot use “email” as your Variable Name.

Joins

A join node doesn’t create multiple triggers/instances like a loop, but can bring multiple branches back together in a task tree. The different branches can have completely different processes, and the join can then route them down a unifying path.

JoinDialog.jpg

There are three options for the type of join node, All, Any or Some. Depending on your choice the node will be marked as complete and processing will continue.

  • All – All connectors leading into the join node must be completed
  • Any – Any single complete connector
  • Some – Specify the number of completed connectors

Junctions

A variation on a join is the Junction node. There are no conditions to tthe node, like a Join node. Instead, it will cause the tree to wait until all the branches that meet at the junction are complete. Even if this means that the branch coming into the node terminated before they reached the junction node.