You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Jon Coogan <jo...@hotmail.com> on 2009/04/02 23:07:27 UTC

Problem with query expressions

Hi.  I’m having a problem when copying data from one variable to another within a forEach loop.  When I use a query to copy data out of a variable I get a selection failure fault at runtime.  This works correctly when I copy from an expression instead of a query.  



I have attached an example that demonstrates the problem.  The expected output of the attached BPEL process is the string “five”.  It works correctly when using an expression, but fails when using a query.  Here is the relevant snippet:



<bpws:forEach counterName="Counter" name="ForEach" parallel="no">

  <bpws:startCounterValue expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[1]]></bpws:startCounterValue>

  <bpws:finalCounterValue expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[count($Data/ns0:Record)]]></bpws:finalCounterValue>

  <bpws:scope>

    <bpws:assign validate="no">

      <bpws:copy>

        <!-- ---------------------------------------------------------------------------- -->

        <!-- This generates a selection failure at runtime. -->

        <bpws:from variable="Data">

            <bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[/ns0:Record[$Counter]/ns0:SomeValue]]></bpws:query>

        </bpws:from>



        <!-- This works. -->

        <!-- <bpws:from expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[$Data/ns0:Record[$Counter]/ns0:SomeValue]]></bpws:from> -->

        <!-- ---------------------------------------------------------------------------- -->



        <bpws:to part="payload" variable="output"/>

      </bpws:copy>

     </bpws:assign>

  </bpws:scope>

</bpws:forEach>



I have tested this with Ode 1.2 and a recent build of Ode 1.X and both behave the same.  Can someone tell me if I am doing something wrong?  Or should I write a bug report for this?



Thanks for your time.

-Jon











------ End of Forwarded Message


_________________________________________________________________
Rediscover Hotmail®: Get quick friend updates right in your inbox. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates1_042009