Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BPEL 2.0: evaluating node values in forEach loop

rich24011Apr 3 2013 — edited Feb 26 2020
[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
This post has been answered by h_kumari on Apr 3 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2013
Added on Apr 3 2013
3 comments
2,558 views