BPEL 2.0: evaluating node values in forEach loop
[Using BPEL 2.0, SOA Suite 11G (11.1.1.6.0) Linux Virtual Box on Windows 7]
this seems like it should be fairly straightforward, but for some reason it's eluding me. i'm running a database query to get back a list of the network nodes in a system. then i'm running a forEach across the result set using an XML node count as a loop limit. all this is working fine.
here's the problem. now i'm simply (?) trying to assign the value of the current UID node in the loop to a local variable, using concat and the loop index. so, the value should be something like "401" or "523". however, what i'm actually getting back is the concatenated XPath itself, so as the loop iterates, my variable comes out as follows:
<currentNetworkNodeID xsi:type="def:string">$networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid[1]</currentNetworkNodeID>
...
<currentNetworkNodeID xsi:type="def:string">$networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid[2]</currentNetworkNodeID>
etc...
i've tried appending "/text()" at the end, using ora:getNodeValue(...), etc., but nothing i've tried will give me my actual node value. if i simply use "$networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid" i get a multi-selection fault, as expected, as there is always more than one executionNetworkNodeUid.
how can i actually evaluate these XPaths to assign the actual node value to my variable...? can i do this in a simple assign, as i'm trying to do, or do i need to use a Transform...?
here's the relevant code:
<forEach parallel="no" counterName="nodeCounter"
name="forEachNetworkNode">
<startCounterValue>1</startCounterValue>
<finalCounterValue>count($networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode)</finalCounterValue>
<scope name="Scope1">
<variables>
<variable name="currentNetworkNodeID" type="xsd:string"/>
</variables>
<sequence name="Sequence1">
<assign name="assignCurrentNodeID">
<copy>
<from>concat('$networkNodesOutputVariable.ExecutionNetworkNodeCollection/ns6:ExecutionNetworkNode/ns6:executionNetworkNodeUid[',$nodeCounter,']')</from>
<to>$currentNetworkNodeID</to>
</copy>
</assign>
</sequence>
</scope>
</forEach>
Edited by: rhoward on Apr 3, 2013 3:08 PM