You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Anup Chandran <an...@3ds.com> on 2007/09/05 21:26:03 UTC

Mapping Arrays

Hi 

Can someone guide me on how to map arrays in an assign activity.

My BPEL definition has a variable "getInstanceInfoOutput"

<bpws:variable messageType="ns0:getInstanceInfoOutput"
name="getInstanceInfoOutput"/>

The pmapi.wsdl has this definition for getInstanceInfoOutput
    <message name="getInstanceInfoOutput">
        <part name="instance-info" type="typ:tInstanceInfo"/>
    </message>

I'm try to map elements of "instance-info" into a String[] (which is the
input for an external service).

The definition of the external service input data types are as follows.

 <wsdl:types>
  <schema targetNamespace="http://client.engineering.cbp.jpo"
xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="ArrayOf_xsd_string">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
     </restriction>
    </complexContent>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="setAttributeRequest">

      <wsdl:part name="in0" type="soapenc:string"/>

      <wsdl:part name="in1" type="impl:ArrayOf_xsd_string"/>

      <wsdl:part name="in2" type="impl:ArrayOf_xsd_string"/>

   </wsdl:message>


My Assign looks like this: Not sure if it is correct. I'm trying to map iid
and other attributes from instance-info into an array of in1.

<bpws:assign name="AssignInstanceInfoToSetAttribute" validate="no">
<bpws:copy>
<bpws:from part="instance-info" variable="getInstanceInfoOutput">
<bpws:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[/ns:iid]]></bpws:query>
</bpws:from>
<bpws:to part="in1" variable="CBPWorkflowPartnerLinkRequest">
<bpws:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">in1[0]</bpws:query>
</bpws:to>
</bpws:copy>
</bpws:assign>

Regards
Anup
-- 
View this message in context: http://www.nabble.com/Mapping-Arrays-tf4387603.html#a12509191
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: Mapping Arrays

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

You'll need to use XSLT to perform assignments between arrays of different
structure.   To give you an idea...  (this is not tested/valid XSL)

<xsl:template match="/">
  <soapenc:array>
    <xsl:for-each select="instance-info/id">
      <entry><xsl:value-of select="id"/></entry>
    </xsl:for-each>
  </soapenc:array>
</xsl:template>


Note that SOAP encoding is not supported so that might be a bigger
consideration.

alex


On 9/5/07, Anup Chandran <an...@3ds.com> wrote:
>
>
> Hi
>
> Can someone guide me on how to map arrays in an assign activity.
>
> My BPEL definition has a variable "getInstanceInfoOutput"
>
> <bpws:variable messageType="ns0:getInstanceInfoOutput"
> name="getInstanceInfoOutput"/>
>
> The pmapi.wsdl has this definition for getInstanceInfoOutput
>     <message name="getInstanceInfoOutput">
>         <part name="instance-info" type="typ:tInstanceInfo"/>
>     </message>
>
> I'm try to map elements of "instance-info" into a String[] (which is the
> input for an external service).
>
> The definition of the external service input data types are as follows.
>
> <wsdl:types>
>   <schema targetNamespace="http://client.engineering.cbp.jpo"
> xmlns="http://www.w3.org/2001/XMLSchema">
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>    <complexType name="ArrayOf_xsd_string">
>     <complexContent>
>      <restriction base="soapenc:Array">
>       <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
>      </restriction>
>     </complexContent>
>    </complexType>
>   </schema>
> </wsdl:types>
>
>    <wsdl:message name="setAttributeRequest">
>
>       <wsdl:part name="in0" type="soapenc:string"/>
>
>       <wsdl:part name="in1" type="impl:ArrayOf_xsd_string"/>
>
>       <wsdl:part name="in2" type="impl:ArrayOf_xsd_string"/>
>
>    </wsdl:message>
>
>
> My Assign looks like this: Not sure if it is correct. I'm trying to map
> iid
> and other attributes from instance-info into an array of in1.
>
> <bpws:assign name="AssignInstanceInfoToSetAttribute" validate="no">
> <bpws:copy>
> <bpws:from part="instance-info" variable="getInstanceInfoOutput">
> <bpws:query
> queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0
> "><![CDATA[/ns:iid]]></bpws:query>
> </bpws:from>
> <bpws:to part="in1" variable="CBPWorkflowPartnerLinkRequest">
> <bpws:query
> queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0
> ">in1[0]</bpws:query>
> </bpws:to>
> </bpws:copy>
> </bpws:assign>
>
> Regards
> Anup
> --
> View this message in context:
> http://www.nabble.com/Mapping-Arrays-tf4387603.html#a12509191
> Sent from the Apache Ode User mailing list archive at Nabble.com.
>
>