You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by monika7 <mo...@maco-tech.com> on 2008/12/29 19:44:13 UTC

how initialize complex array in ODE PBEL

Hi,

I realize this is primarily ServiceMix user list and my question is ODE
specific (already posted this question to the ODE user list), but I am short
on time and hope that someone, who uses ODE with ServiceMix, can suggest a
solution to my problem.

I am using ServiceMix 3.3 and ODE JBI version 1.2
The process is accessed via servicemix-http consumer endpoint. Another
servicemix-http provider endpoint is used to access external web service
from the bpel process.

Here are relevant pieces of my bpel process:

....
 <variables>
    ...      
<variable name="planInputs" messageType="plan:SubmitRequests" />
<variable name="planOutputs" messageType="plan:SubmitResponses" />
   ...   
</variables> 
...

// receives request to the process via soap with planInputs as incoming
message
<receive>

... // the first assign works
<assign name="AssignPlanInputSubmitRequestToResourceManager">
<copy>             
<from>$planInputs.body/plan:submitRequest[1]</from>            
<to variable="SubmitRequest" part="Submit"/>         
</copy>      
</assign> 

//invokes external web service which returns SubmitResponse which has to be
copied to planOutputs
<invoke> 

// this assign throws Xpath exception
<assign name="AssignSubmitResponseToPlanOutput">         
<copy>            
<from variable="SubmitResponse" part="SubmitRequestResponse"/>           
<to>$planOutputs.body/plan:submitResponse[1]</to>         
</copy>
</assign> 

<reply>

-----------------

SubmitRequests and SubmitResponses schema

<xs:element name="SubmitRequests" type="SubmitRequests"/>

<xs:complexType name="SubmitRequests">
	<xs:sequence>
		<xs:element name="submitRequest" type="rm:SubmitType" minOccurs="1"
maxOccurs="unbounded">
			<xs:annotation>
				<xs:documentation>
					List of submit requests
				</xs:documentation>
			</xs:annotation>
		</xs:element>
	</xs:sequence>
</xs:complexType>
	
<xs:element name="SubmitResponses" type="SubmitResponses"/>
	
<xs:complexType name="SubmitResponses">
	<xs:sequence>
		<xs:element name="submitResponse" type="rm:SubmitRequestResponseType"
minOccurs="1" maxOccurs="unbounded">
			<xs:annotation>
				<xs:documentation>
					List of submit responses
				</xs:documentation>
			</xs:annotation>
		</xs:element>
	</xs:sequence>
</xs:complexType>

As you can see, one of my assignment statements in bpel process needs to
copy another variable to the first position of that array, but because array
is not initialized (empty), I get Xpath exception:
Unmapped Fault :
{http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure:
No results for expression: {OXPath10Expression
$planOutputs.body/plan:submitResponse[1]}

I am fairly confident that the Xpath expression for the assignment is
correct, because another assignment from a variable which is also
messageType with its part being array ( see planInputs above)  to an
individual variable works. The  difference between these two variables is
that planInputs gets initialized automatically because it is an incoming
argument of process wsdl method. 

If I switch my bpel process to return a single response, the second
assignment works correctly and I get correct soap response from the process.


Monika

-- 
View this message in context: http://www.nabble.com/how-initialize-complex-array-in-ODE-PBEL-tp21207352p21207352.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.