Hi Alex, Yes, I figured it out yesterday, but I didn't want to post my reply to my question to everyone from [EMAIL PROTECTED] - that would look a little bit weird ;)
thanks any way! best regards Łukasz On 31/01/2008, Alex Boisvert <[EMAIL PROTECTED]> wrote: > Hi Lukasz, > > Your first assignment needs to initialize the (internal) structure of the > variable before you can select and assign into the elements in it, e.g., > > <copy> > <from> > <literal> > <ns1:log> > <ns1:id/> > <ns1:timestamp/> > <ns1:type/> > <ns1:message/> > </ns1:log> > </literal> > </from> > <to>$LoggerServiceRequest.parameters</to> > </copy> > > cheers, > alex > > On 1/30/08, Łukasz Budnik <[EMAIL PROTECTED]> wrote: > > > > Hi All! > > > > I have a problem with copying values to/from complexTypes. > > > > I've seen tests of simple assigns activities here: > > > > http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/TestAssign.bpel?view=markup > > > > http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity2/TestAssign.bpel?view=markup > > > > also there is a complex type test: > > > > http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignComplex/ComplexVariables-Variable.bpel?view=markup > > > > but above tests don't show how to access a single element inside a complex > > one. > > > > I have a web service which request looks like this: > > > > <wsdl:message name="logRequest"> > > <wsdl:part name="parameters" element="ns0:log" /> > > </wsdl:message> > > > > and the log element is as follows: > > > > <xs:element name="log"> > > <xs:complexType> > > <xs:sequence> > > <xs:element minOccurs="0" name="id" > > type="xs:long" /> > > <xs:element minOccurs="0" name="timestamp" > > type="xs:long" /> > > <xs:element minOccurs="0" name="type" > > type="xs:string" /> > > <xs:element minOccurs="0" name="message" > > nillable="true" type="xs:anyType"/> > > </xs:sequence> > > </xs:complexType> > > </xs:element> > > > > now, in BPEL I have declared a proper variable: > > > > <bpws:variable messageType="ns1:logRequest" name="LoggerServiceRequest"/> > > > > initialized it before usage: > > > > <bpws:assign name="Init-Log-Variable" validate="no"> > > <bpws:copy> > > <bpws:from> > > <bpws:literal> > > <ns1:logRequest > > xmlns:ns1="http://axiom.ws.tomcat.sandbox.nuntius.xh.org"/> > > </bpws:literal> > > </bpws:from> > > <bpws:to><![CDATA[$LoggerServiceRequest.parameters]]></bpws:to> > > </bpws:copy> > > </bpws:assign> > > > > and tried to assign values to id, timestamp, type and message: > > > > <bpws:assign name="Populate-Log-Variable" validate="no"> > > <bpws:copy> > > <bpws:from> > > <bpws:literal>123</bpws:literal> > > </bpws:from> > > <bpws:to part="parameters" variable="LoggerServiceRequest"> > > <bpws:query><![CDATA[/ns1:id]]></bpws:query> > > </bpws:to> > > </bpws:copy> > > <bpws:copy> > > <bpws:from> > > <bpws:literal>123456</bpws:literal> > > </bpws:from> > > <bpws:to part="parameters" variable="LoggerServiceRequest"> > > <bpws:query><![CDATA[/ns1:timestamp]]></bpws:query> > > </bpws:to> > > </bpws:copy> > > <bpws:copy> > > <bpws:from> > > <bpws:literal>test</bpws:literal> > > </bpws:from> > > <bpws:to part="parameters" variable="LoggerServiceRequest"> > > <bpws:query><![CDATA[/ns1:type]]></bpws:query> > > </bpws:to> > > </bpws:copy> > > <bpws:copy> > > <bpws:from part="payload" variable="input"> > > <bpws:query><![CDATA[/tns:input]]></bpws:query> > > </bpws:from> > > <bpws:to part="parameters" variable="LoggerServiceRequest"> > > <bpws:query><![CDATA[/ns1:message]]></bpws:query> > > </bpws:to> > > </bpws:copy> > > </bpws:assign> > > > > the result is selectionFailure: > > > > ERROR - GeronimoLog.error(104) | Assignment Fault: > > {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFa > > ilure,lineNo=70,faultExplanation=No results for expression: > > {OXPath10Expression /ns1:id} > > DEBUG - GeronimoLog.debug(66) | ProcessImpl completed with fault > > '{ > > http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure' > > DEBUG - GeronimoLog.debug(66) | Processing an async reply from service > > {http://bpel.ode.sandbox.nuntius.xh.org}OdeTest3Service > > > > my BPEL is generated with Eclipse BPEL Designer... > > > > are there any other examples that illustrate the usage of complex types in > > Ode? > > > > best regards > > Łukasz > > >
