[JBoss jBPM] - handle arrays in bpel
by sw_bpel
hello,
i have some problems with handling arrays in my bpel-process. i have to invoke 3 web services and the response of the first one contains an array of user roles. so first i declare a variable for the iteration and also a variable for the number of elements in the array. then i create a while loop to check if the array contains a specific role. in that case i call the second web service. so far that's working fine, but the second web service returns also an array. but now i want to return this response as a part of the bpel process response. and here is my problem. How do i do that? i either get only the first element of the array as response of the bpel process or i get the following error:
| 15:42:48,209 ERROR [XPathEvaluator] cannot create element for step with non-numeric predicate: [(DefaultNameStep): bpelReturnSW]
|
how to do that array handling?
a fragment of my bpel-file:
| <bpws:sequence name="Sequence1">
| <bpws:assign name="assignSukoInput" validate="no">
| <bpws:copy>
| <bpws:from><![CDATA['']]></bpws:from>
| <bpws:to><![CDATA[$sukoRequest.getAllUnits]]></bpws:to>
| </bpws:copy>
| </bpws:assign>
| <bpws:invoke inputVariable="sukoRequest"
| name="invokeSukoService" operation="getAllUnits"
| outputVariable="sukoResponse" partnerLink="suko"
| portType="ns1:Fidefri4amo" />
| <bpws:assign name="assignSukoCounter" validate="no">
| <bpws:copy>
| <bpws:from><![CDATA[1]]></bpws:from>
| <bpws:to variable="sukoIterator" />
| </bpws:copy>
| <bpws:copy>
| <bpws:from><![CDATA[count($sukoResponse.getAllUnitsResponse/return)]]></bpws:from>
| <bpws:to variable="sukoCounter" />
| </bpws:copy>
| </bpws:assign>
| <bpws:while name="While">
| <bpws:condition><![CDATA[$sukoCounter >= $sukoIterator]]></bpws:condition>
| <bpws:sequence name="Sequence2">
| <bpws:assign name="assignSukoOutput" validate="no">
| <bpws:copy>
| <bpws:from><![CDATA[$sukoResponse.getAllUnitsResponse/return[$sukoIterator]/id]]></bpws:from>
| <bpws:to><![CDATA[$output.bpelResponse/bpelReturnSuko[$sukoIterator]/bpelResponseSukoUnitID]]></bpws:to>
| </bpws:copy>
| <bpws:copy>
| <bpws:from><![CDATA[$sukoResponse.getAllUnitsResponse/return[$sukoIterator]/name]]></bpws:from>
| <bpws:to><![CDATA[$output.bpelResponse/bpelReturnSuko[$sukoIterator]/bpelResponseSukoUnitName]]></bpws:to>
| </bpws:copy>
| </bpws:assign>
| <bpws:assign name="stepSukoIterator" validate="no">
| <bpws:copy>
| <bpws:from><![CDATA[$sukoIterator + 1]]></bpws:from>
| <bpws:to variable="sukoIterator" />
| </bpws:copy>
| </bpws:assign>
| </bpws:sequence>
| </bpws:while>
| </bpws:sequence>
|
thank you for your help!!!!
greetings stefan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186410#4186410
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4186410
17 years, 5 months
[JBoss jBPM] - Re: advice needed, simultaneously active tasks where there i
by rossputin
Hi,
I will go through the process and ensure the tasks are 'blocking'.
What I am keen to do, is gain the ability to recreate this multi-state behavior.
We are using a modified version of the demo JSF webapp to allow users to work through several different processes. So transitioning is similar to in the demo webapp.
At the bottom of 'task.xhtml' we have...
| <gd:repeat value="#{transitions}" var="transition" idVar="rid">
|
| ......
|
| <a href="#" onclick="transitionTaskForm('transition#{rid}', '#{transition.name}');">
| <h:outputText value="#{transition.name}"/>
| </a>
|
| <h:commandLink id="transition#{rid}" style="display:none; visibility: hidden;">
| <h:outputText value="#{transition.name}" rendered="#{! empty transition.name}"/>
| <gs:i rendered="#{empty transition.name}">
| <h:outputText value="End : (unnamed)"/>
| </gs:i>
| <ga:attribute name="rendered" value="#{! task.suspended}"/>
| <f:param name="id" value="#{id}"/>
| <ga:parameter name="id" target="#{id}">
| <f:convertNumber integerOnly="true"/>
| </ga:parameter>
| <j4j:loadTask id="#{id}" target="#{task}"/>
| <j4j:completeTask task="#{task}" transition="#{transition.name}"/>
| <n:nav outcome="success" url="myportal.jsf" storeMessages="true"/>
| <n:nav outcome="error" redirect="true" storeMessages="true"/>
| </h:commandLink>
|
| ......
|
| </gd:repeat>
|
So we hide the commandLink and point to a javascript function which does some client side validation, and then calls either...
transLink.dispatchEvent(evObj);
or
transLink.fireEvent('onclick');
which is a click on the required 'transition' command link...
What I am keen to know, is clicking on these transition links, while the tasks are not 'blocking' possibly causing this multi-state behavior ?
Thanks for your help,
regards,
Ross
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186372#4186372
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4186372
17 years, 5 months