Using forEach and dynamic partner references

Let us now modify the previous example. Instead of statically coding into BPEL that we wish to call two different insurances, InsuranceA and InsuranceB, let us change the example and call an arbitrary number of Insurance services using a<forEach> loop.

To achieve this, we need to figure out how to use dynamic partner references. The<invoke> activity within the loop namely has to invoke a different service each time the loop is iterated. This means that we cannot set the partner link for the service statically in code, but have to do this dynamically.

Dynamic partner references

We will first create a variable that can hold partner link references. As we already know, the partner link references use the ...

Get WS-BPEL 2.0 for SOA Composite Applications with IBM WebSphere 7 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.