Time for action – appending multiple values to a variable
Carry out the following steps:
Drag-and-drop an
<assign>
activity after the<invoke>
activity namedinvoke_search_web_search
, double-click on it, and go to the Copy Rules tab. Create a new copy rule and then choose$invoke_search_web_service_search_OutputVariable.output
as the From expression and$outputVariable.payload
as the To expression. Then right-click on that copy rule and go to Change rule type and select Append. Then click on Apply and then on OK, as shown in the following screenshot:The BPEL is ready for testing and deployment:
What just happened?
In the preceding section, we collated all the responses from repetitive web service invocations into a single variable called outputVariable
.
Understanding the <forEach> loop
Frequently in real life, we need to perform some tasks repeatedly. This typical behavior is common for computer programs, as well. Almost all the programming languages define language constructs...