<!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;"> </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;"> </p><p><bpel:forEach parallel="no" counterName="i" name="ForEach"></p><p>            <bpel:startCounterValue></p><p>                <![CDATA[1]]></p><p>            </bpel:startCounterValue></p><p>            <bpel:finalCounterValue><![CDATA[count($SAPCCResponse.centroCostoResponse/return/zcoCecos/item)]]></bpel:finalCounterValue></p><p>            <bpel:scope></p><p>                <bpel:assign validate="no" name="Assign1"></p><p>                    </p><p>                    </p><p>                    <bpel:copy></p><p>                        <bpel:from part="centroCostoResponse" variable="SAPCCResponse"></p><p>                            <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[return/zcoCecos/item[$i]/Ceco]]></bpel:query></p><p>                        </bpel:from></p><p>                        <bpel:to part="payload" variable="CentroCostoLinkResponse"></p><p>                            <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"></p><p>                                <![CDATA[ItabCecos/item[number($i)]/Ceco]]></p><p>                            </bpel:query></p><p>                        </bpel:to></p><p>                    </bpel:copy></p><p>                </bpel:assign></p><p>            </bpel:scope></p><p>        </bpel:forEach></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>But when I consume de Bpel process throws an exception:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>I changue to 2.0   urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0</strong></p><p>16:18:36,254 INFO  [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service</p><p class="gmail_quote">_sapcentrocostosservicio was not found in the registry<br/>  16:18:36,694 INFO  [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 '<?xml version="1.0" encoding="UTF-8"?><br/>  <ZcoCecoGetResponse xmlns="<a class="jive-link-external-small" href="http://SAPCentroCostos/wsdl" rel="nofollow" target="_blank">http://SAPCentroCostos/wsdl</a>"/>'</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>I changue to</strong><strong> 2.0   urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0 quitando el atributo number()</strong><br/>  16:20:06,308 INFO  [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service_sapcentrocostosservicio was not found in the registry<br/>16:20:06,824 INFO  [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;"> </p><p><strong>I changue to</strong><strong>   urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0</strong><br/>16:22:06,331 INFO  [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service_sapcentrocostosservicio was not found in the registry<br/>  16:22:06,785 INFO  [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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </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>