<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Use For Each in Bpel Process
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/smorales">Sebastian Morales</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/800393#800393">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I'm trying to iterate a List from a Webservice SOAP with ForEach</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;bpel:forEach parallel="no" counterName="i" name="ForEach"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:startCounterValue&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;![CDATA[1]]&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpel:startCounterValue&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:finalCounterValue&gt;&lt;![CDATA[count($SAPCCResponse.centroCostoResponse/return/zcoCecos/item)]]&gt;&lt;/bpel:finalCounterValue&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:scope&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:assign validate="no" name="Assign1"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:copy&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:from part="centroCostoResponse" variable="SAPCCResponse"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"&gt;&lt;![CDATA[return/zcoCecos/item[$i]/Ceco]]&gt;&lt;/bpel:query&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpel:from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:to part="payload" variable="CentroCostoLinkResponse"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;![CDATA[ItabCecos/item[number($i)]/Ceco]]&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpel:query&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpel:to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpel:copy&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpel:assign&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpel:scope&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpel:forEach&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>But when I consume de Bpel process throws an exception:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>I changue to 2.0&#160;&#160; urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0</strong></p><p>16:18:36,254 INFO&#160; [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service</p><p class="gmail_quote">_sapcentrocostosservicio was not found in the registry<br/>&#160; 16:18:36,694 INFO&#160; [ASSIGN] Assignment Fault: {<a class="jive-link-external-small" href="http://docs.oasis-open.org/wsbpel/2.0/process/executable%7DselectionFailure,lineNo=149,faultExplanation=No" rel="nofollow" target="_blank">http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=149,faultExplanation=No</a> results for expression: 'ItabCecos/item[number($i)]/Ceco' against '&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br/>&#160; &lt;ZcoCecoGetResponse xmlns="<a class="jive-link-external-small" href="http://SAPCentroCostos/wsdl" rel="nofollow" target="_blank">http://SAPCentroCostos/wsdl</a>"/&gt;'</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>I changue to</strong><strong> 2.0&#160;&#160; urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0 quitando el atributo number()</strong><br/>&#160; 16:20:06,308 INFO&#160; [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service_sapcentrocostosservicio was not found in the registry<br/>16:20:06,824 INFO&#160; [ASSIGN] Assignment Fault: {<a class="jive-link-external-small" href="http://docs.oasis-open.org/wsbpel/2.0/process/executable%7DsubLanguageExecutionFault,lineNo=149,faultExplanation=An" rel="nofollow" target="_blank">http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecutionFault,lineNo=149,faultExplanation=An</a> exception occured while evaluating "{OXPath10Expression return/zcoCecos/item[$i]/Ceco}": Error while executing an XPath expression: </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>I changue to</strong><strong>&#160;&#160; urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0</strong><br/>16:22:06,331 INFO&#160; [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service_sapcentrocostosservicio was not found in the registry<br/>&#160; 16:22:06,785 INFO&#160; [ASSIGN] Assignment Fault: {<a class="jive-link-external-small" href="http://docs.oasis-open.org/wsbpel/2.0/process/executable%7DselectionFailure,lineNo=149,faultExplanation=Multiple" rel="nofollow" target="_blank">http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=149,faultExplanation=Multiple</a> results for expression: {OXPath10Expression return/zcoCecos/item[$i]/Ceco}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Any Idea why I get this error and the Bpel Process don't operate.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/800393#800393">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>