Using assign
Draft comment:
This topic was viewed 10 times since its publication
Use the assign activity to manipulate data within your
BPEL process and map data from one location to another.
This topic was viewed 10 times since its publication
About this task
Procedure
Example: using arrays in assign and forEach activities
This example will demonstrate how you can use an assign activity to iterate an array within a forEach activity.
- Create a business object called
MyBOwith an element calledarrayof type string, and with the property of array. - Create a new BPEL process, and have the interface generated automatically.
- Create a new variable called
VarArrayin your BPEL process that calls MyBO. - Drop an assign activity between the existing Receive and Reply
activities, and create three values as follows:
- In the Assign from field, open the code
assist, select String (enter a value), and
type
test 01. - In the corresponding Assign To field, select . The value
VarArray array[1]appears in the field. - Click Add to create a new field in the assign activity.
- Repeat these steps twice more, increasing the numeric value each
time so that it matches the following screen capture:
Note: You will not be able to edit the Assign To value directly. To make changes toarray [1], click the Edit Query icon (
, and make
changes to the field in the XPath Expression Builder window.
- In the Assign from field, open the code
assist, select String (enter a value), and
type
- Drop a forEach activity below the assign activity, and configure
it as follows:
- In the Details tab, under the Iteration heading, click none in the Type field, and select .
- Drop an assign activity into the forEach activity.
- In the Assign from field, select .
- Modify the automatically generated
VarArray array[1]to beVarArray array[bpws:getVariableData('Index')]. - In the corresponding Assign To field, select Input 1: string.
- Drop a snippet activity below the assign activity, and add the
following code to it:
System.out.println( "In ForEach: " + Input1 );.

This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15