You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Luca Clementi <l....@cineca.it> on 2007/05/30 16:07:38 UTC

problems with xpath selection

Hi all,

we are trying to make some variable manipulation in a bpel 
file with xpath but I can not find what I do wrong...


This is the wsdl of the service I invoke (airbus.wsdl):
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:ns0="http://www.a-ware.org/airbus/xsd" xmlns:tns="http://www.a-ware.org/airbus/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="airbus" targetNamespace="http://www.a-ware.org/airbus/xsd">
  <wsdl:types>
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.a-ware.org/airbus/xsd" 
                xmlns:tns="http://www.a-ware.org/airbus/xsd" 
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <!-- return type =============================================-->
  <xsd:complexType name="return_type">
    <xsd:sequence>
      <xsd:element name="exitValue" type="xsd:integer"/>
      <xsd:element name="stdout" type="xsd:string"/>
      <xsd:element name="stdin" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>
  <!-- =================================================== -->

  <!-- PAAM  ============================================= -->
  <xsd:element name="PAAM_in" type="tns:PAAM_in_type"/>
  <xsd:complexType name="PAAM_in_type">
    <xsd:sequence>
      <xsd:element ref="tns:frequency"/>  
      <xsd:element ref="tns:templateFile"/>  
      <xsd:element name="parameters" type="tns:parameters_type"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="templateFile" type="xsd:string"/>

  <xsd:element name="frequency" type="xsd:float"/>

  <xsd:complexType name="parameters_type">
    <xsd:sequence maxOccurs="unbounded">
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element name="value" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="PAAM_out" type="tns:PAAM_out_type"/>
  <xsd:complexType name="PAAM_out_type">
        <xsd:sequence>
      <xsd:element name="modelFileName" type="xsd:string"/>
      <xsd:element name="tclscriptFileName" type="xsd:string"/>
      <xsd:element name="return" type="tns:return_type"/>
        </xsd:sequence>
  </xsd:complexType>
   [some other types]
  </xsd:schema>

  </wsdl:types>
  <wsdl:message name="paamInput">
    <wsdl:part element="tns:PAAM_in" name="body">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="paamOutput">
    <wsdl:part element="tns:PAAM_out" name="body">
    </wsdl:part>
  </wsdl:message>
   [some other messages]
  <wsdl:portType name="airbusPortType">
    <wsdl:operation name="paam">
      <wsdl:input message="tns:paamInput">
    </wsdl:input>
      <wsdl:output message="tns:paamOutput">
    </wsdl:output>
    </wsdl:operation>
    
    [some other operations]

  </wsdl:portType>
</wsdl:definitions>



The wsdl of the process I try to execute is (airbusTest.wsdl):
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="http://www.a-ware.org/bpel/airbusTest/wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:pln="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.a-ware.org/airbus/xsd">
    <import location="airbus.wsdl" namespace="http://www.a-ware.org/airbus/xsd"/>
    <types>
<schema targetNamespace="http://www.a-ware.org/bpel/airbusTest/wsdl" xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:xsd="http://www.a-ware.org/airbus/xsd" elementFormDefault="qualified">
        <import namespace="http://www.a-ware.org/airbus/xsd" schemaLocation="airbus.xsd" />    
        <!-- airbus.xsd contains exactly the schema of the previous wsdl -->
        <element name="ProcessInstantiation_data_outElement">
                <complexType>
                        <sequence>
                                <element ref="xsd:templateFile"  />
                                <element name="frequencies">
                                        <complexType>
                                                <sequence>
                                                        <element ref="xsd:frequency" minOccurs="1" maxOccurs="unbounded" />
                                                </sequence>
                                        </complexType>
                                </element>
                                <element name="parameters">
                                        <complexType>
                                                <sequence>
                                                        <element name="parameter" type="xsd:parameters_type" minOccurs="1" maxOccurs="unbounded" />
                                                </sequence>
                                        </complexType>
                                </element>
                        </sequence>
                </complexType>
        </element>
        <element name="e5_EndMessage_data_inElement">
                <complexType>
                        <sequence>
                                <element name="PAAM_out" type="xsd:PAAM_out_type" />
                                <element name="IcemCFD_out" type="xsd:IcemCFD_out_type" />
                                <element name="ANADEL_out" type="xsd:ANADEL_out_type" />
                                <element name="MOVE_D01_out"
                                        type="xsd:MOVE_D01_out_type" />
                        </sequence>
                </complexType>
        </element>
</schema>
    </types>
    <message name="ProcessInstantiation_data_out">
        <part element="wsdl:ProcessInstantiation_data_outElement" name="body"/>
    </message>
    <message name="e5_EndMessage_data_in">
        <part element="wsdl:e5_EndMessage_data_inElement" name="body"/>
    </message>

	[portType and partnerLinks]

</definitions>


While the process is (airbusTest.bpel):
<?xml version="1.0" encoding="UTF-8"?>
<process name="airbusTest"
    targetNamespace="http://www.a-ware.org/bpel/airbusTest/bpel"
    xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
    xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.a-ware.org/airbus/xsd">
    <!--bpmn2bpel Version 1.0-->
    <import importType="http://schemas.xmlsoap.org/wsdl/"
        location="airbusTest.wsdl" namespace="http://www.a-ware.org/bpel/airbusTest/wsdl"/>
    <import importType="http://schemas.xmlsoap.org/wsdl/"
        location="airbus.wsdl" namespace="http://www.a-ware.org/airbus/xsd"/>
    <partnerLinks>
	[partner links]
    </partnerLinks>
    <variables>
        <!--List variables used in this BPEL process-->
        <variable messageType="xsd:paamOutput" name="n0_PAAM_data_out"/>
        <variable messageType="xsd:paamInput" name="n0_PAAM_data_in"/>
        [some other variable]
        <variable messageType="wsdl:ProcessInstantiation_data_out" name="ProcessInstantiation_data_out"/>
        <variable messageType="wsdl:e5_EndMessage_data_in" name="e5_EndMessage_data_in"/>
        <variable name="counter" type="xs:integer"/>
    </variables>
    <sequence name="sequenceComponent_3">
        <receive createInstance="yes" name="ProcessInstantiation" operation="localPT" partnerLink="client"
            portType="wsdl:airbusTestPT" variable="ProcessInstantiation_data_out"/>
        <assign name="MyAssign">
            <copy>
                <from>1</from>
                <to variable="counter"/>
            </copy>
        </assign>
        <sequence>
            <while >
                <condition> ( ($counter - 1) &lt; count($ProcessInstantiation_data_out.body/wsdl:frequencies/xsd:frequency) ) </condition>
                <sequence name="sequenceComponent_0">
                    <assign name="d0_InputData">
                        <copy> 
                                <from><literal>
                                        <xsd:PAAM_in xmlns:xsd="http://www.a-ware.org/airbus/xsd">
                                               <xsd:frequency>4</xsd:frequency>
                                               <xsd:templateFile>string</xsd:templateFile>
                                               <xsd:parameters>
                                                     <xsd:name>string</xsd:name>
                                                     <xsd:value>string</xsd:value>
                                               </xsd:parameters>
                                        </xsd:PAAM_in>
                                </literal></from>
                                <to variable="n0_PAAM_data_in" part="body"><query>/</query></to>
                        </copy>
                        <copy>  <!--  the frequencies -->
                            <from variable="ProcessInstantiation_data_out" part="body"><query>/wsdl:frequencies/xsd:frequency[1]</query></from>
                            <to variable="n0_PAAM_data_in" part="body"><query>/</query></to>
                        </copy>
                        <copy>
                                <from variable="ProcessInstantiation_data_out" part="body"><query>/xsd:templateFile</query></from>
                                <to variable="n0_PAAM_data_in" part="body"><query>/</query></to>
                        </copy>
                    </assign>

                    <invoke inputVariable="n0_PAAM_data_in" name="n0_PAAM" operation="paam"
                        outputVariable="n0_PAAM_data_out" partnerLink="xsd_airbusPortTypePL" portType="xsd:airbusPortType"/>

		    [other invokes and assigns]
                    <assign name="Increment_Assign">
                        <copy>
                            <from>  ( $counter + 1 )  </from>
                            <to variable="counter"/>
                        </copy>
                    </assign>
                </sequence>
            </while>
        </sequence>
        <assign name="d26_ANADEL_out">
            <copy>
		[I prepare the output variable]
            </copy>
        </assign>
        <reply name="e5_EndMessage" operation="localPT" partnerLink="client" 
	portType="wsdl:airbusTestPT" variable="e5_EndMessage_data_in"/>
    </sequence>
</process>

the input message I send to the process is:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:ProcessInstantiation_data_outElement xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl" 
                                           xmlns:xsd="http://www.a-ware.org/airbus/xsd">
   <xsd:templateFile>pluto</xsd:templateFile>
   <wsdl:frequencies>
           <xsd:frequency>7.1</xsd:frequency>
           <xsd:frequency>3.2</xsd:frequency>
   </wsdl:frequencies>
   <wsdl:parameters>
                <wsdl:parameter>
                        <xsd:name>string</xsd:name>
                        <xsd:value>string</xsd:value>
                </wsdl:parameter>
   </wsdl:parameters>
</wsdl:ProcessInstantiation_data_outElement>

But the message I receive when I invoke paam is:

The message received by paam is <xsd:PAAM_in xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl" xmlns:xsd="http://www.a-ware.org/airbus/xsd">
  <xsd:templateFile>pluto</xsd:templateFile>
  <wsdl:frequencies>
    <xsd:frequency>7.1</xsd:frequency>
    <xsd:frequency>3.2</xsd:frequency>
  </wsdl:frequencies>
  <wsdl:parameters>
    <wsdl:parameter>
      <xsd:name>prova</xsd:name>
      <xsd:value>bene</xsd:value>
    </wsdl:parameter>
  </wsdl:parameters>
</xsd:PAAM_in>

So the problem is  at the second assign (<assign name="d0_InputData">) 
with the frequencies where I try to select only one of the frequency
/wsdl:frequencies/xsd:frequency[1]
but it seams that ODE selects the entire branch and copy it into the 
destination variable. My final goal is to use counter as an index: 
/wsdl:frequencies/xsd:frequency[$counter]
But this obviously doesn't work either.

What am I doing wrong?


I have tried every think but it seems that the notation "[]" gets 
always ignored by ode.

I am using apache-ode-jbi-1.0-RC4-incubating-SNAPSHOT.zip which I 
built from the SVN trunk at 2007-05-24, in service mix 
3.2-incubating-SNAPSHOT.


Thank you for your help,
Luca







Re: problems with xpath selection

Posted by Luca Clementi <l....@cineca.it>.

Alex Boisvert wrote:
> Hi Luca,
> 
> Indeed this looks like a bug in the BPEL 1.1. compatibility area....  for
> now I'd recommend using the BPEL 2.0 syntax ($variable.part/...)
> 
> Can you file a Jira issue?   That way, it will get on our TODO list.
> 
> thanks for reporting,
> alex
> 

Done.
Maybe just reporting this in some part of the documentation can save 
time to other people, while it is not fixed.

Sincerely,
Luca



-------- Original Message --------
Subject: [jira] Created: (ODE-143) bug in the BPEL 1.1/2.0 compativility 
in copying variables
Date: Sat, 2 Jun 2007 13:40:15 -0700 (PDT)
From: Luca Clementi (JIRA) <ji...@apache.org>
To: l.clementi@cineca.it

bug in the BPEL 1.1/2.0 compativility in copying variables
----------------------------------------------------------

                  Key: ODE-143
                  URL: https://issues.apache.org/jira/browse/ODE-143
              Project: Ode
           Issue Type: Bug
           Components: BPEL Runtime
     Affects Versions: 1.0-incubating, Incubator, 1.1-incubating
          Environment: Java 5
ServiceMIX 3.2-incubating-SNAPSHOT
             Reporter: Luca Clementi


There is a problem when copying variables.

if the old BPEL 1.0 format is used to select variables parts e.g.:
<from variable="variable_name" 
part="variable_part"><query>query</query></from>
<to variable="variable_name" part="variable_part"><query>query</query></to>
the behavior of the engine is not correct, it select randomly the 
variable's parts.


While if the other format is used (BPEL 2.0) the assign works properly, 
for example:
<from>$variable_name.variable_part/query</from>
<to>$variable_name.variable_part/query</to>

Luca



Re: problems with xpath selection

Posted by Alex Boisvert <bo...@intalio.com>.
Hi Luca,

Indeed this looks like a bug in the BPEL 1.1. compatibility area....  for
now I'd recommend using the BPEL 2.0 syntax ($variable.part/...)

Can you file a Jira issue?   That way, it will get on our TODO list.

thanks for reporting,
alex

On 5/31/07, Luca Clementi <l....@cineca.it> wrote:
>
> Hi all,
> I have been doing some more testing on this issue, and I
> discovered that simply changing the notation of the assign
> modify the behavior of the engine.
>
> Using a:
>       <assign name="d0_InputData">
>          <copy>
>             <from><literal>
>                <xsd:PAAM_in xmlns:xsd="http://www.a-ware.org/airbus/xsd">
>                   <xsd:frequency>4</xsd:frequency>
>                   <xsd:templateFile>string</xsd:templateFile>
>                   <xsd:parameters>
>                      <xsd:name>string</xsd:name>
>                      <xsd:value>string</xsd:value>
>                   </xsd:parameters>
>                </xsd:PAAM_in>
>             </literal></from>
>             <to variable="n0_PAAM_data_in"
> part="body"><query>/</query></to>
>           </copy>
>           <copy>
>             <from variable="ProcessInstantiation_data_out"
> part="body"><query>/xsd:templateFile</query></from>
>             <to variable="n0_PAAM_data_in"
> part="body"><query>/xsd:templateFile</query></to>
>           </copy>
>         </assign>
>
> output this weird message
>
> The message received by paam is
> <xsd:PAAM_in xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl"
> xmlns:xsd="http://www.a-ware.org/airbus/xsd">
>   <xsd:templateFile>pluto</xsd:templateFile>
>   <wsdl:frequencies>
>     <xsd:frequency>7.1</xsd:frequency>
>     <xsd:frequency>3.2</xsd:frequency>
>   </wsdl:frequencies>
>   <wsdl:parameters>
>     <wsdl:parameter>
>       <xsd:name>prova</xsd:name>
>       <xsd:value>bene</xsd:value>
>     </wsdl:parameter>
>   </wsdl:parameters>
> </xsd:PAAM_in>
>
> While if I use the other notation for the assign
>
>     <from>$ProcessInstantiation_data_out.body/xsd:templateFile</from>
>     <to>$n0_PAAM_data_in.body/xsd:templateFile</to>
>
> I get the right message:
> The message received by paam is
> <xsd:PAAM_in xmlns:xsd="http://www.a-ware.org/airbus/xsd">
>   <xsd:frequency>4</xsd:frequency>
>   <xsd:templateFile>pluto</xsd:templateFile>
>   <xsd:parameters>
>     <xsd:name>string</xsd:name>
>     <xsd:value>string</xsd:value>
>   </xsd:parameters>
> </xsd:PAAM_in>
>
>
>
> I thought that the two format of the assign were equivalent...
>
> 1>    <from variable="ProcessInstantiation_data_out"
> part="body"><query>/xsd:templateFile</query></from>
> 1>    <to variable="n0_PAAM_data_in"
> part="body"><query>/xsd:templateFile</query></to>
>
> 2>    <from>$ProcessInstantiation_data_out.body/xsd:templateFile</from>
> 2>    <to>$n0_PAAM_data_in.body/xsd:templateFile</to>
>
>
> And why if I use the first format it outputs such a weird message?
>
>
> Thank you,
> Luca
>
>
> Luca Clementi wrote:
> > Hi all,
> >
> > we are trying to make some variable manipulation in a bpel
> > file with xpath but I can not find what I do wrong...
> >
> >
> > This is the wsdl of the service I invoke (airbus.wsdl):
> > <?xml version="1.0" encoding="UTF-8"?>
> > <wsdl:definitions xmlns:ns0="http://www.a-ware.org/airbus/xsd"
> xmlns:tns="http://www.a-ware.org/airbus/xsd" xmlns:wsdl="
> http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema" name="airbus" targetNamespace="
> http://www.a-ware.org/airbus/xsd">
> >   <wsdl:types>
> >     <xsd:schema elementFormDefault="qualified" targetNamespace="
> http://www.a-ware.org/airbus/xsd"
> >                 xmlns:tns="http://www.a-ware.org/airbus/xsd"
> >                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >   <!-- return type =============================================-->
> >   <xsd:complexType name="return_type">
> >     <xsd:sequence>
> >       <xsd:element name="exitValue" type="xsd:integer"/>
> >       <xsd:element name="stdout" type="xsd:string"/>
> >       <xsd:element name="stdin" type="xsd:string"/>
> >     </xsd:sequence>
> >   </xsd:complexType>
> >   <!-- =================================================== -->
> >
> >   <!-- PAAM  ============================================= -->
> >   <xsd:element name="PAAM_in" type="tns:PAAM_in_type"/>
> >   <xsd:complexType name="PAAM_in_type">
> >     <xsd:sequence>
> >       <xsd:element ref="tns:frequency"/>
> >       <xsd:element ref="tns:templateFile"/>
> >       <xsd:element name="parameters" type="tns:parameters_type"/>
> >     </xsd:sequence>
> >   </xsd:complexType>
> >
> >   <xsd:element name="templateFile" type="xsd:string"/>
> >
> >   <xsd:element name="frequency" type="xsd:float"/>
> >
> >   <xsd:complexType name="parameters_type">
> >     <xsd:sequence maxOccurs="unbounded">
> >       <xsd:element name="name" type="xsd:string"/>
> >       <xsd:element name="value" type="xsd:string"/>
> >     </xsd:sequence>
> >   </xsd:complexType>
> >
> >   <xsd:element name="PAAM_out" type="tns:PAAM_out_type"/>
> >   <xsd:complexType name="PAAM_out_type">
> >         <xsd:sequence>
> >       <xsd:element name="modelFileName" type="xsd:string"/>
> >       <xsd:element name="tclscriptFileName" type="xsd:string"/>
> >       <xsd:element name="return" type="tns:return_type"/>
> >         </xsd:sequence>
> >   </xsd:complexType>
> >    [some other types]
> >   </xsd:schema>
> >
> >   </wsdl:types>
> >   <wsdl:message name="paamInput">
> >     <wsdl:part element="tns:PAAM_in" name="body">
> >     </wsdl:part>
> >   </wsdl:message>
> >   <wsdl:message name="paamOutput">
> >     <wsdl:part element="tns:PAAM_out" name="body">
> >     </wsdl:part>
> >   </wsdl:message>
> >    [some other messages]
> >   <wsdl:portType name="airbusPortType">
> >     <wsdl:operation name="paam">
> >       <wsdl:input message="tns:paamInput">
> >     </wsdl:input>
> >       <wsdl:output message="tns:paamOutput">
> >     </wsdl:output>
> >     </wsdl:operation>
> >
> >     [some other operations]
> >
> >   </wsdl:portType>
> > </wsdl:definitions>
> >
> >
> >
> > The wsdl of the process I try to execute is (airbusTest.wsdl):
> > <?xml version="1.0" encoding="UTF-8"?>
> > <definitions targetNamespace="http://www.a-ware.org/bpel/airbusTest/wsdl
> "
> >     xmlns="http://schemas.xmlsoap.org/wsdl/"
> >     xmlns:pln="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"
> >     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >     xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl"
> >     xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="
> http://www.a-ware.org/airbus/xsd">
> >     <import location="airbus.wsdl" namespace="
> http://www.a-ware.org/airbus/xsd"/>
> >     <types>
> > <schema targetNamespace="http://www.a-ware.org/bpel/airbusTest/wsdl"
> xmlns="http://www.w3.org/2001/XMLSchema"
> >         xmlns:xsd="http://www.a-ware.org/airbus/xsd"
> elementFormDefault="qualified">
> >         <import namespace="http://www.a-ware.org/airbus/xsd"
> schemaLocation="airbus.xsd" />
> >         <!-- airbus.xsd contains exactly the schema of the previous wsdl
> -->
> >         <element name="ProcessInstantiation_data_outElement">
> >                 <complexType>
> >                         <sequence>
> >                                 <element ref="xsd:templateFile"  />
> >                                 <element name="frequencies">
> >                                         <complexType>
> >                                                 <sequence>
> >                                                         <element
> ref="xsd:frequency" minOccurs="1" maxOccurs="unbounded" />
> >                                                 </sequence>
> >                                         </complexType>
> >                                 </element>
> >                                 <element name="parameters">
> >                                         <complexType>
> >                                                 <sequence>
> >                                                         <element
> name="parameter" type="xsd:parameters_type" minOccurs="1"
> maxOccurs="unbounded" />
> >                                                 </sequence>
> >                                         </complexType>
> >                                 </element>
> >                         </sequence>
> >                 </complexType>
> >         </element>
> >         <element name="e5_EndMessage_data_inElement">
> >                 <complexType>
> >                         <sequence>
> >                                 <element name="PAAM_out"
> type="xsd:PAAM_out_type" />
> >                                 <element name="IcemCFD_out"
> type="xsd:IcemCFD_out_type" />
> >                                 <element name="ANADEL_out"
> type="xsd:ANADEL_out_type" />
> >                                 <element name="MOVE_D01_out"
> >                                         type="xsd:MOVE_D01_out_type" />
> >                         </sequence>
> >                 </complexType>
> >         </element>
> > </schema>
> >     </types>
> >     <message name="ProcessInstantiation_data_out">
> >         <part element="wsdl:ProcessInstantiation_data_outElement"
> name="body"/>
> >     </message>
> >     <message name="e5_EndMessage_data_in">
> >         <part element="wsdl:e5_EndMessage_data_inElement" name="body"/>
> >     </message>
> >
> >       [portType and partnerLinks]
> >
> > </definitions>
> >
> >
> > While the process is (airbusTest.bpel):
> > <?xml version="1.0" encoding="UTF-8"?>
> > <process name="airbusTest"
> >     targetNamespace="http://www.a-ware.org/bpel/airbusTest/bpel"
> >     xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
> >     xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
> >     xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl"
> >     xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="
> http://www.a-ware.org/airbus/xsd">
> >     <!--bpmn2bpel Version 1.0-->
> >     <import importType="http://schemas.xmlsoap.org/wsdl/"
> >         location="airbusTest.wsdl" namespace="
> http://www.a-ware.org/bpel/airbusTest/wsdl"/>
> >     <import importType="http://schemas.xmlsoap.org/wsdl/"
> >         location="airbus.wsdl" namespace="
> http://www.a-ware.org/airbus/xsd"/>
> >     <partnerLinks>
> >       [partner links]
> >     </partnerLinks>
> >     <variables>
> >         <!--List variables used in this BPEL process-->
> >         <variable messageType="xsd:paamOutput" name="n0_PAAM_data_out"/>
> >         <variable messageType="xsd:paamInput" name="n0_PAAM_data_in"/>
> >         [some other variable]
> >         <variable messageType="wsdl:ProcessInstantiation_data_out"
> name="ProcessInstantiation_data_out"/>
> >         <variable messageType="wsdl:e5_EndMessage_data_in"
> name="e5_EndMessage_data_in"/>
> >         <variable name="counter" type="xs:integer"/>
> >     </variables>
> >     <sequence name="sequenceComponent_3">
> >         <receive createInstance="yes" name="ProcessInstantiation"
> operation="localPT" partnerLink="client"
> >             portType="wsdl:airbusTestPT"
> variable="ProcessInstantiation_data_out"/>
> >         <assign name="MyAssign">
> >             <copy>
> >                 <from>1</from>
> >                 <to variable="counter"/>
> >             </copy>
> >         </assign>
> >         <sequence>
> >             <while >
> >                 <condition> ( ($counter - 1) &lt;
> count($ProcessInstantiation_data_out.body/wsdl:frequencies/xsd:frequency) )
> </condition>
> >                 <sequence name="sequenceComponent_0">
> >                     <assign name="d0_InputData">
> >                         <copy>
> >                                 <from><literal>
> >                                         <xsd:PAAM_in xmlns:xsd="
> http://www.a-ware.org/airbus/xsd">
>
> >                                                <xsd:frequency>4</xsd:frequency>
>
> >                                                <xsd:templateFile>string</xsd:templateFile>
> >                                                <xsd:parameters>
>
> >                                                      <xsd:name>string</xsd:name>
>
> >                                                      <xsd:value>string</xsd:value>
> >                                                </xsd:parameters>
> >                                         </xsd:PAAM_in>
> >                                 </literal></from>
> >                                 <to variable="n0_PAAM_data_in"
> part="body"><query>/</query></to>
> >                         </copy>
> >                         <copy>  <!--  the frequencies -->
> >                             <from
> variable="ProcessInstantiation_data_out"
> part="body"><query>/wsdl:frequencies/xsd:frequency[1]</query></from>
> >                             <to variable="n0_PAAM_data_in"
> part="body"><query>/</query></to>
> >                         </copy>
> >                         <copy>
> >                                 <from
> variable="ProcessInstantiation_data_out"
> part="body"><query>/xsd:templateFile</query></from>
> >                                 <to variable="n0_PAAM_data_in"
> part="body"><query>/</query></to>
> >                         </copy>
> >                     </assign>
> >
> >                     <invoke inputVariable="n0_PAAM_data_in"
> name="n0_PAAM" operation="paam"
> >                         outputVariable="n0_PAAM_data_out"
> partnerLink="xsd_airbusPortTypePL" portType="xsd:airbusPortType"/>
> >
> >                   [other invokes and assigns]
> >                     <assign name="Increment_Assign">
> >                         <copy>
> >                             <from>  ( $counter + 1 )  </from>
> >                             <to variable="counter"/>
> >                         </copy>
> >                     </assign>
> >                 </sequence>
> >             </while>
> >         </sequence>
> >         <assign name="d26_ANADEL_out">
> >             <copy>
> >               [I prepare the output variable]
> >             </copy>
> >         </assign>
> >         <reply name="e5_EndMessage" operation="localPT"
> partnerLink="client"
> >       portType="wsdl:airbusTestPT" variable="e5_EndMessage_data_in"/>
> >     </sequence>
> > </process>
> >
> > the input message I send to the process is:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <wsdl:ProcessInstantiation_data_outElement xmlns:wsdl="
> http://www.a-ware.org/bpel/airbusTest/wsdl"
> >                                            xmlns:xsd="
> http://www.a-ware.org/airbus/xsd">
> >    <xsd:templateFile>pluto</xsd:templateFile>
> >    <wsdl:frequencies>
> >            <xsd:frequency>7.1</xsd:frequency>
> >            <xsd:frequency>3.2</xsd:frequency>
> >    </wsdl:frequencies>
> >    <wsdl:parameters>
> >                 <wsdl:parameter>
> >                         <xsd:name>string</xsd:name>
> >                         <xsd:value>string</xsd:value>
> >                 </wsdl:parameter>
> >    </wsdl:parameters>
> > </wsdl:ProcessInstantiation_data_outElement>
> >
> > But the message I receive when I invoke paam is:
> >
> > The message received by paam is <xsd:PAAM_in xmlns:wsdl="
> http://www.a-ware.org/bpel/airbusTest/wsdl" xmlns:xsd="
> http://www.a-ware.org/airbus/xsd">
> >   <xsd:templateFile>pluto</xsd:templateFile>
> >   <wsdl:frequencies>
> >     <xsd:frequency>7.1</xsd:frequency>
> >     <xsd:frequency>3.2</xsd:frequency>
> >   </wsdl:frequencies>
> >   <wsdl:parameters>
> >     <wsdl:parameter>
> >       <xsd:name>prova</xsd:name>
> >       <xsd:value>bene</xsd:value>
> >     </wsdl:parameter>
> >   </wsdl:parameters>
> > </xsd:PAAM_in>
> >
> > So the problem is  at the second assign (<assign name="d0_InputData">)
> > with the frequencies where I try to select only one of the frequency
> > /wsdl:frequencies/xsd:frequency[1]
> > but it seams that ODE selects the entire branch and copy it into the
> > destination variable. My final goal is to use counter as an index:
> > /wsdl:frequencies/xsd:frequency[$counter]
> > But this obviously doesn't work either.
> >
> > What am I doing wrong?
> >
> >
> > I have tried every think but it seems that the notation "[]" gets
> > always ignored by ode.
> >
> > I am using apache-ode-jbi-1.0-RC4-incubating-SNAPSHOT.zip which I
> > built from the SVN trunk at 2007-05-24, in service mix
> > 3.2-incubating-SNAPSHOT.
> >
> >
> > Thank you for your help,
> > Luca
> >
> >
> >
> >
> >
> >
> >
>

Re: problems with xpath selection

Posted by Luca Clementi <l....@cineca.it>.
Hi all,
I have been doing some more testing on this issue, and I 
discovered that simply changing the notation of the assign 
modify the behavior of the engine.

Using a:
      <assign name="d0_InputData">
         <copy> 
            <from><literal>
               <xsd:PAAM_in xmlns:xsd="http://www.a-ware.org/airbus/xsd">
                  <xsd:frequency>4</xsd:frequency>
                  <xsd:templateFile>string</xsd:templateFile>
                  <xsd:parameters>
                     <xsd:name>string</xsd:name>
                     <xsd:value>string</xsd:value>
                  </xsd:parameters>
               </xsd:PAAM_in>
            </literal></from>
            <to variable="n0_PAAM_data_in" part="body"><query>/</query></to>
          </copy>
          <copy>
            <from variable="ProcessInstantiation_data_out" part="body"><query>/xsd:templateFile</query></from>
            <to variable="n0_PAAM_data_in" part="body"><query>/xsd:templateFile</query></to>
          </copy>
        </assign>

output this weird message

The message received by paam is 
<xsd:PAAM_in xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl" xmlns:xsd="http://www.a-ware.org/airbus/xsd">
  <xsd:templateFile>pluto</xsd:templateFile>
  <wsdl:frequencies>
    <xsd:frequency>7.1</xsd:frequency>
    <xsd:frequency>3.2</xsd:frequency>
  </wsdl:frequencies>
  <wsdl:parameters>
    <wsdl:parameter>
      <xsd:name>prova</xsd:name>
      <xsd:value>bene</xsd:value>
    </wsdl:parameter>
  </wsdl:parameters>
</xsd:PAAM_in>

While if I use the other notation for the assign 

    <from>$ProcessInstantiation_data_out.body/xsd:templateFile</from>
    <to>$n0_PAAM_data_in.body/xsd:templateFile</to>

I get the right message:
The message received by paam is 
<xsd:PAAM_in xmlns:xsd="http://www.a-ware.org/airbus/xsd">
  <xsd:frequency>4</xsd:frequency>
  <xsd:templateFile>pluto</xsd:templateFile>
  <xsd:parameters>
    <xsd:name>string</xsd:name>
    <xsd:value>string</xsd:value>
  </xsd:parameters>
</xsd:PAAM_in>



I thought that the two format of the assign were equivalent...

1>    <from variable="ProcessInstantiation_data_out" part="body"><query>/xsd:templateFile</query></from>
1>    <to variable="n0_PAAM_data_in" part="body"><query>/xsd:templateFile</query></to>

2>    <from>$ProcessInstantiation_data_out.body/xsd:templateFile</from>
2>    <to>$n0_PAAM_data_in.body/xsd:templateFile</to>


And why if I use the first format it outputs such a weird message?


Thank you,
Luca


Luca Clementi wrote:
> Hi all,
> 
> we are trying to make some variable manipulation in a bpel 
> file with xpath but I can not find what I do wrong...
> 
> 
> This is the wsdl of the service I invoke (airbus.wsdl):
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions xmlns:ns0="http://www.a-ware.org/airbus/xsd" xmlns:tns="http://www.a-ware.org/airbus/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="airbus" targetNamespace="http://www.a-ware.org/airbus/xsd">
>   <wsdl:types>
>     <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.a-ware.org/airbus/xsd" 
>                 xmlns:tns="http://www.a-ware.org/airbus/xsd" 
>                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 
>   <!-- return type =============================================-->
>   <xsd:complexType name="return_type">
>     <xsd:sequence>
>       <xsd:element name="exitValue" type="xsd:integer"/>
>       <xsd:element name="stdout" type="xsd:string"/>
>       <xsd:element name="stdin" type="xsd:string"/>
>     </xsd:sequence>
>   </xsd:complexType>
>   <!-- =================================================== -->
> 
>   <!-- PAAM  ============================================= -->
>   <xsd:element name="PAAM_in" type="tns:PAAM_in_type"/>
>   <xsd:complexType name="PAAM_in_type">
>     <xsd:sequence>
>       <xsd:element ref="tns:frequency"/>  
>       <xsd:element ref="tns:templateFile"/>  
>       <xsd:element name="parameters" type="tns:parameters_type"/>
>     </xsd:sequence>
>   </xsd:complexType>
> 
>   <xsd:element name="templateFile" type="xsd:string"/>
> 
>   <xsd:element name="frequency" type="xsd:float"/>
> 
>   <xsd:complexType name="parameters_type">
>     <xsd:sequence maxOccurs="unbounded">
>       <xsd:element name="name" type="xsd:string"/>
>       <xsd:element name="value" type="xsd:string"/>
>     </xsd:sequence>
>   </xsd:complexType>
> 
>   <xsd:element name="PAAM_out" type="tns:PAAM_out_type"/>
>   <xsd:complexType name="PAAM_out_type">
>         <xsd:sequence>
>       <xsd:element name="modelFileName" type="xsd:string"/>
>       <xsd:element name="tclscriptFileName" type="xsd:string"/>
>       <xsd:element name="return" type="tns:return_type"/>
>         </xsd:sequence>
>   </xsd:complexType>
>    [some other types]
>   </xsd:schema>
> 
>   </wsdl:types>
>   <wsdl:message name="paamInput">
>     <wsdl:part element="tns:PAAM_in" name="body">
>     </wsdl:part>
>   </wsdl:message>
>   <wsdl:message name="paamOutput">
>     <wsdl:part element="tns:PAAM_out" name="body">
>     </wsdl:part>
>   </wsdl:message>
>    [some other messages]
>   <wsdl:portType name="airbusPortType">
>     <wsdl:operation name="paam">
>       <wsdl:input message="tns:paamInput">
>     </wsdl:input>
>       <wsdl:output message="tns:paamOutput">
>     </wsdl:output>
>     </wsdl:operation>
>     
>     [some other operations]
> 
>   </wsdl:portType>
> </wsdl:definitions>
> 
> 
> 
> The wsdl of the process I try to execute is (airbusTest.wsdl):
> <?xml version="1.0" encoding="UTF-8"?>
> <definitions targetNamespace="http://www.a-ware.org/bpel/airbusTest/wsdl"
>     xmlns="http://schemas.xmlsoap.org/wsdl/"
>     xmlns:pln="http://schemas.xmlsoap.org/ws/2004/03/partner-link/"
>     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>     xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl"
>     xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.a-ware.org/airbus/xsd">
>     <import location="airbus.wsdl" namespace="http://www.a-ware.org/airbus/xsd"/>
>     <types>
> <schema targetNamespace="http://www.a-ware.org/bpel/airbusTest/wsdl" xmlns="http://www.w3.org/2001/XMLSchema"
>         xmlns:xsd="http://www.a-ware.org/airbus/xsd" elementFormDefault="qualified">
>         <import namespace="http://www.a-ware.org/airbus/xsd" schemaLocation="airbus.xsd" />    
>         <!-- airbus.xsd contains exactly the schema of the previous wsdl -->
>         <element name="ProcessInstantiation_data_outElement">
>                 <complexType>
>                         <sequence>
>                                 <element ref="xsd:templateFile"  />
>                                 <element name="frequencies">
>                                         <complexType>
>                                                 <sequence>
>                                                         <element ref="xsd:frequency" minOccurs="1" maxOccurs="unbounded" />
>                                                 </sequence>
>                                         </complexType>
>                                 </element>
>                                 <element name="parameters">
>                                         <complexType>
>                                                 <sequence>
>                                                         <element name="parameter" type="xsd:parameters_type" minOccurs="1" maxOccurs="unbounded" />
>                                                 </sequence>
>                                         </complexType>
>                                 </element>
>                         </sequence>
>                 </complexType>
>         </element>
>         <element name="e5_EndMessage_data_inElement">
>                 <complexType>
>                         <sequence>
>                                 <element name="PAAM_out" type="xsd:PAAM_out_type" />
>                                 <element name="IcemCFD_out" type="xsd:IcemCFD_out_type" />
>                                 <element name="ANADEL_out" type="xsd:ANADEL_out_type" />
>                                 <element name="MOVE_D01_out"
>                                         type="xsd:MOVE_D01_out_type" />
>                         </sequence>
>                 </complexType>
>         </element>
> </schema>
>     </types>
>     <message name="ProcessInstantiation_data_out">
>         <part element="wsdl:ProcessInstantiation_data_outElement" name="body"/>
>     </message>
>     <message name="e5_EndMessage_data_in">
>         <part element="wsdl:e5_EndMessage_data_inElement" name="body"/>
>     </message>
> 
> 	[portType and partnerLinks]
> 
> </definitions>
> 
> 
> While the process is (airbusTest.bpel):
> <?xml version="1.0" encoding="UTF-8"?>
> <process name="airbusTest"
>     targetNamespace="http://www.a-ware.org/bpel/airbusTest/bpel"
>     xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
>     xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
>     xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl"
>     xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.a-ware.org/airbus/xsd">
>     <!--bpmn2bpel Version 1.0-->
>     <import importType="http://schemas.xmlsoap.org/wsdl/"
>         location="airbusTest.wsdl" namespace="http://www.a-ware.org/bpel/airbusTest/wsdl"/>
>     <import importType="http://schemas.xmlsoap.org/wsdl/"
>         location="airbus.wsdl" namespace="http://www.a-ware.org/airbus/xsd"/>
>     <partnerLinks>
> 	[partner links]
>     </partnerLinks>
>     <variables>
>         <!--List variables used in this BPEL process-->
>         <variable messageType="xsd:paamOutput" name="n0_PAAM_data_out"/>
>         <variable messageType="xsd:paamInput" name="n0_PAAM_data_in"/>
>         [some other variable]
>         <variable messageType="wsdl:ProcessInstantiation_data_out" name="ProcessInstantiation_data_out"/>
>         <variable messageType="wsdl:e5_EndMessage_data_in" name="e5_EndMessage_data_in"/>
>         <variable name="counter" type="xs:integer"/>
>     </variables>
>     <sequence name="sequenceComponent_3">
>         <receive createInstance="yes" name="ProcessInstantiation" operation="localPT" partnerLink="client"
>             portType="wsdl:airbusTestPT" variable="ProcessInstantiation_data_out"/>
>         <assign name="MyAssign">
>             <copy>
>                 <from>1</from>
>                 <to variable="counter"/>
>             </copy>
>         </assign>
>         <sequence>
>             <while >
>                 <condition> ( ($counter - 1) &lt; count($ProcessInstantiation_data_out.body/wsdl:frequencies/xsd:frequency) ) </condition>
>                 <sequence name="sequenceComponent_0">
>                     <assign name="d0_InputData">
>                         <copy> 
>                                 <from><literal>
>                                         <xsd:PAAM_in xmlns:xsd="http://www.a-ware.org/airbus/xsd">
>                                                <xsd:frequency>4</xsd:frequency>
>                                                <xsd:templateFile>string</xsd:templateFile>
>                                                <xsd:parameters>
>                                                      <xsd:name>string</xsd:name>
>                                                      <xsd:value>string</xsd:value>
>                                                </xsd:parameters>
>                                         </xsd:PAAM_in>
>                                 </literal></from>
>                                 <to variable="n0_PAAM_data_in" part="body"><query>/</query></to>
>                         </copy>
>                         <copy>  <!--  the frequencies -->
>                             <from variable="ProcessInstantiation_data_out" part="body"><query>/wsdl:frequencies/xsd:frequency[1]</query></from>
>                             <to variable="n0_PAAM_data_in" part="body"><query>/</query></to>
>                         </copy>
>                         <copy>
>                                 <from variable="ProcessInstantiation_data_out" part="body"><query>/xsd:templateFile</query></from>
>                                 <to variable="n0_PAAM_data_in" part="body"><query>/</query></to>
>                         </copy>
>                     </assign>
> 
>                     <invoke inputVariable="n0_PAAM_data_in" name="n0_PAAM" operation="paam"
>                         outputVariable="n0_PAAM_data_out" partnerLink="xsd_airbusPortTypePL" portType="xsd:airbusPortType"/>
> 
> 		    [other invokes and assigns]
>                     <assign name="Increment_Assign">
>                         <copy>
>                             <from>  ( $counter + 1 )  </from>
>                             <to variable="counter"/>
>                         </copy>
>                     </assign>
>                 </sequence>
>             </while>
>         </sequence>
>         <assign name="d26_ANADEL_out">
>             <copy>
> 		[I prepare the output variable]
>             </copy>
>         </assign>
>         <reply name="e5_EndMessage" operation="localPT" partnerLink="client" 
> 	portType="wsdl:airbusTestPT" variable="e5_EndMessage_data_in"/>
>     </sequence>
> </process>
> 
> the input message I send to the process is:
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:ProcessInstantiation_data_outElement xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl" 
>                                            xmlns:xsd="http://www.a-ware.org/airbus/xsd">
>    <xsd:templateFile>pluto</xsd:templateFile>
>    <wsdl:frequencies>
>            <xsd:frequency>7.1</xsd:frequency>
>            <xsd:frequency>3.2</xsd:frequency>
>    </wsdl:frequencies>
>    <wsdl:parameters>
>                 <wsdl:parameter>
>                         <xsd:name>string</xsd:name>
>                         <xsd:value>string</xsd:value>
>                 </wsdl:parameter>
>    </wsdl:parameters>
> </wsdl:ProcessInstantiation_data_outElement>
> 
> But the message I receive when I invoke paam is:
> 
> The message received by paam is <xsd:PAAM_in xmlns:wsdl="http://www.a-ware.org/bpel/airbusTest/wsdl" xmlns:xsd="http://www.a-ware.org/airbus/xsd">
>   <xsd:templateFile>pluto</xsd:templateFile>
>   <wsdl:frequencies>
>     <xsd:frequency>7.1</xsd:frequency>
>     <xsd:frequency>3.2</xsd:frequency>
>   </wsdl:frequencies>
>   <wsdl:parameters>
>     <wsdl:parameter>
>       <xsd:name>prova</xsd:name>
>       <xsd:value>bene</xsd:value>
>     </wsdl:parameter>
>   </wsdl:parameters>
> </xsd:PAAM_in>
> 
> So the problem is  at the second assign (<assign name="d0_InputData">) 
> with the frequencies where I try to select only one of the frequency
> /wsdl:frequencies/xsd:frequency[1]
> but it seams that ODE selects the entire branch and copy it into the 
> destination variable. My final goal is to use counter as an index: 
> /wsdl:frequencies/xsd:frequency[$counter]
> But this obviously doesn't work either.
> 
> What am I doing wrong?
> 
> 
> I have tried every think but it seems that the notation "[]" gets 
> always ignored by ode.
> 
> I am using apache-ode-jbi-1.0-RC4-incubating-SNAPSHOT.zip which I 
> built from the SVN trunk at 2007-05-24, in service mix 
> 3.2-incubating-SNAPSHOT.
> 
> 
> Thank you for your help,
> Luca
> 
> 
> 
> 
> 
> 
>