Saturday, January 8, 2011

BPEL how to loop over elements of a collection

In BPEL, if you want to get the value of an indexed variable, like in this XPath:

/ns5:PreactivationCollection/ns5:Preactivation[$lineIndex]

you must do some acrobatics using a "concat" function:

bpws:getVariableData('Invoke_ReadLinesForLot_ReadLinesForLotSelect_OutputVariable','PreactivationCollection',concat('/ns5:PreactivationCollection/ns5:Preactivation[', bpws:getVariableData('lineIndex'), ']'))"


This is the mess you end up entangled with when, instead of using a proper programming language (DSL), you resort to XML to implement your programming needs.

BPEL is yet another EXTREMELY poor implementation of something which otherwise contains powerful programming paradigms.

No comments: