I am building a BPEL process in Netbeans 6.8 and I invoke a Web Service that returns a list of ints.
<xs:complexType name="getHotelsResponse">
<xs:sequence>
<xs:element name="return" type="xs:int" minOccurs="0" maxOccurs="unbounded"></xs:element>
</xs:sequence>
</xs:complexType>
I want (if possible – not sure anymore…) to iterate through all those ints and invoke a different Web Service for each one of them.
I tried using a ForEach activity, but I can’t figure out the usage for my case.
It requires a Start Value and an End Value (if I could somehow get how many ints I got back) but even then inside the ForEach activity if say I put an Assign activity how do I get the current element of the list in each loop?
I used following BPEL snippet to concat the content of a list in to a comma separated string.
You can use the same code with an invoke to call external service.
You can get the count of elements from the following XPath
You can access value of the i th element using the following XPath
You may get rid of the round() function, but I had to use to get rid of an issue in Apache ODE.