IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing business processes > Building BPEL processes > Defining BPEL process logic

Work with XPath in the BPEL process editor

There are several places in the BPEL process editor where you have the option of using the XPath standard.

When you are presented with the opportunity to use the XPath standard, you will be able to compose the XPath expression in one of two ways.

You can use the XPath expression builder to visually create the message, or you can build it yourself manually.

For information on how to use the XPath expression builder, see XPath Expression Builder

For more information on XPath 1.0, see http://www.w3.org/TR/xpath.


Example: Using XPath to iterate an array

The following example shows how XPath can be used to iterate through the members of an array within a Business Object.

count(bpws:getVariableData('Input1', 'values'))
bpws:getVariableData('index') <= bpws:getVariableData('size') 
concat('values[', bpws:getVariableData('index'), ']')
bpws:getVariableData('Input1', bpws:getVariableData('query')) 
variable is incremented:  bpws:getVariableData('index') + 1 

This snippet begins by getting a count of the array elements that need to be copied, and assigns that value to an integer called size. The BO is contained in the Input1 variable, which contains an array of items in the values array element. Then it uses a while loop to iterate through the array, and builds a string with the value of values[n], where n is the value of the index variable. The string is stored in a variable called query. Then, the code retrieves the actual value of the array element, and increments the index variable.

Work with basic activities

Defining BPEL process logic


Related concepts:
The building blocks of the BPEL process editor
Dealing with faults in your BPEL process
Work with micropatterns
Locked activities


Related tasks:
Use assign
Adding an interface or a reference to a business state machine
Adding a variable to a business state machine
Adding a process application as an activity
Adding an activity to a BPEL process
Defining transactional behavior
Defining timer-driven behavior in a BPEL process
Enabling SCA events to be emitted
Calling other BPEL processes
Calling business services


Related reference:
Details tab: BPEL process editor