Skip to main content
Version: 5.1.1.0

Description

A loop makes it possible to do certain activities multiple times.

Configuration

Click an activity, then go to the Non-Functional tab (third tab) in the configuration panel.

'loop_actived'

A loop is commonly just sensible if you have a kind of list, e.g. messagelist. Additionally a counter is often needed. Please make sure you declared these two variables in properties of process model.

The following kind of loops are possible:

Standard

The standard iteration implements its own logic. The activity doesn't have to be connected to a channel.

'loop_standard'

The standard loop statements are written in programming language. To declare some libraries and classes to use, open the drop-down selection Archives & Import-Declaration. For usage of other Orchestra and java classes you can add a external archive of type Standard Java Archive. To import the necessary classes please declare your import statements in Import declaration field.

As you can see in the example above do you have to fulfill three text fields with the necessary code:

  • Init statement(s): Code, which has to be done before starting the iterations. E.g. reset counter, ensure Objects are given.

  • Check expression: This statement must return a Boolean value. If it is true the loop is doing one more iteration otherwise it will stop.

  • Increment statement(s):The body of a iteration. This is the logic of each iteration. E.g. in case of a list iteration the statements, which have to be done with each list record. If you use a counter don't forget the increment of it.

Message iteration

This loop iterates through a list of Orchestra messages. The messages get successive sent to the connected channel.

'loop_message_iteration'

To do this iteration three objects are necessary:

  • Messagelist: The list, which should be passed. Every element of the list is sent to the channel.

  • Current Message: The "workspace" message, which contains the actual list record.

  • Counter: The counter to iterate through messagelist.

For-Loop

The for-loop is equal to programming a for loop. You're iterating the activity by using a counter variable, to define the number of iterations.

'loop_for_loop'

To execute the loop the following values are necessary:

  • Counter: A counter variable to use for the iteration.

  • start: the beginning value of counter. In most cases 0, but can also be an integer value.

  • end: The end criteria. Can be a value or a variable from process. In example above it is the length of messagelist.

To add these values you can use every process variable. To see a selection do right click on the input field.

You are also able to add a XPath expression by using the XPath Editor. Therefore the Namespace Context pane could be necessary.

XPath-Loop

A XPath loop enables an iteration over the elements of a list. Therefore a Xpath statement is necessary, to define the elements to be processed.

'loop_xpath_loop'

To execute the following values are needed:

  • XPath: The expression to extract the elements to be processed. XPath statements can easily be generated by using XPath Editor.

  • Keep Parent Node: To check this mean allow message fragments to retain full message structure.

  • Messagelist: The list, which should be passed. The intended elements get extracted out of every list record.

  • Current Message: The "workspace" message, which contains the actual list record.

  • Counter: The counter to iterate through messagelist.

  • Namespace: This panel could be necessary for the use of namespaces in the XPath expression.