Hi all,
  I found another BUG-like problem in  ODE 2.0 Build #87 (2009-1-8 2:25:04). 
That is: the counterName variable can't be used in the position expression of 
XPath as normal variables are. For example, the following BPEL piece
          <forEach counterName="i" parallel="no">
                  <startCounterValue>1</startCounterValue>
                  <finalCounterValue>2</finalCounterValue>
                  <scope>
                    <assign>
                      <copy>
                        <from>$i</from>
                        <to>$output0.body/xsd0:field1[position()=$i]</to>     
<!-- note this line -->
                      </copy>
                    </assign>
                  </scope>
                </forEach>
will incur such ERROR in ODE:

ERROR - GeronimoLog.error(104) | Assignment Fault: 
{http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=149,faultExplanation={http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure:
 No results for expression: {OXPath10Expression 
$output0.body/xsd0:field1[position()=$i]}
12:39:37,781 ERROR [ASSIGN] Assignment Fault: 
{http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=149,faultExplanation={http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure:
 No results for expression: {OXPath10Expression 
$output0.body/xsd0:field1[position()=$i]}


But when I simply replace $i with a normal unsignedInt variable $_i1, turning 
the piece above into:
          <forEach counterName="i" parallel="no">
                  <startCounterValue>1</startCounterValue>
                  <finalCounterValue>2</finalCounterValue>
                  <scope>
                    <assign>
                      <copy>
                        <from variable="i" />
                        <to variable="_i1"/>
                      </copy>
                      <copy>
                        <from>$i</from>
                        <to>$output0.body/xsd0:field1[position()=$_i1]</to>     
<!-- note this line -->
                      </copy>
                    </assign>
                  </scope>
                </forEach>
it works fine! How strange! The expression language and query language used are 
both the default one, i.e. XPath 1.0.

Need I commit a bug report to the developers of ODE? :-)

Thanks & Regards.
Wenfeng



        ZHAO Wenfeng
        [email protected]
          2009-01-21

Reply via email to