0 Replies Latest reply: Oct 5, 2009 8:43 AM by 843830 RSS

    help with BPEL - copy values inside of complex type array ???

    843830
      I have a jirasoapservice-v2.wsdl with:

      <complexType name="RemoteIssue">
      <complexContent>
      <extension base="tns1:AbstractRemoteEntity">
      <sequence>
      <element name="customFieldValues" nillable="true" type="impl:ArrayOf_tns1_RemoteCustomFieldValue"/>
      ...
      <complexType name="ArrayOf_tns1_RemoteCustomFieldValue">
      <complexContent>
      <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType"> wsdl:arrayType="tns1:RemoteCustomFieldValue[]"/>
      </restriction>
      </complexContent>
      </complexType>
      ...
      <complexType name="RemoteCustomFieldValue">
      <sequence>
      <element name="customfieldId" nillable="true" type="xsd:string"/>
      <element name="key" nillable="true" type="xsd:string"/>
      <element name="values" nillable="true" type="impl:ArrayOf_xsd_string"/>
      </sequence>
      </complexType>
      ...


      And in BPEL I'm trying this code:

      <?xml version="1.0" encoding="UTF-8"?>
      <process
      name="CosimaJiraProcess"
      targetNamespace="http://enterprise.netbeans.org/bpel/BpelModuleCosimaJira/CosimaJiraProcess"
      xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace"
      xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor"
      xmlns:sxat="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Attachment"
      xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling"
      xmlns:tns="http://enterprise.netbeans.org/bpel/BpelModuleCosimaJira/CosimaJiraProcess" xmlns:sxed2="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2" xmlns:ns0="un:CosimaJira:JiraObject" xmlns:ns1="un:CosimaJira:CosimaObject" xmlns:impl="http://localhost/rpc/soap/jirasoapservice-v2" xmlns:ns2="http://beans.soap.rpc.jira.atlassian.com" xmlns:ns3="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions">

      <import namespace="http://enterprise.netbeans.org/bpel/jirasoapservice-v2Wrapper" location="jirasoapservice-v2Wrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
      <import namespace="http://localhost/rpc/soap/jirasoapservice-v2" location="binding/jirasoapservice-v2.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
      <import namespace="http://j2ee.netbeans.org/wsdl/BpelModuleCosimaJira/JMSCosimaJiraWSDL" location="binding/JMSCosimaJiraWSDL.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
      <partnerLinks>
      <partnerLink name="PartnerLink1" xmlns:tns="http://j2ee.netbeans.org/wsdl/BpelModuleCosimaJira/JMSCosimaJiraWSDL" partnerLinkType="tns:JMSCosimaJiraWSDL" myRole="JMSInPortTypeRole"/>
      <partnerLink name="plJira" xmlns:tns="http://enterprise.netbeans.org/bpel/jirasoapservice-v2Wrapper" partnerLinkType="tns:JiraSoapServiceLinkType" partnerRole="JiraSoapServiceRole"/>
      </partnerLinks>
      <variables>
      <variable name="JMSInOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/BpelModuleCosimaJira/JMSCosimaJiraWSDL" messageType="tns:JMSInputMessage"/>
      <variable name="Token" messageType="impl:loginResponse"/>
      <variable name="LoginIn" messageType="impl:loginRequest"/>
      <variable name="newIssue" type="ns2:RemoteIssue"/>
      <variable name="CreateIssueOut" xmlns:impl="http://localhost/rpc/soap/jirasoapservice-v2" messageType="impl:createIssueResponse"/>
      <variable name="CreateIssueIn" xmlns:impl="http://localhost/rpc/soap/jirasoapservice-v2" messageType="impl:createIssueRequest"/>
      </variables>
      <sequence>
      <receive name="Receive1" createInstance="yes" partnerLink="PartnerLink1" operation="JMSInOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/BpelModuleCosimaJira/JMSCosimaJiraWSDL" portType="tns:JMSInPortType" variable="JMSInOperationIn"/>
      <scope name="Scope1">
      <variables>
      <variable name="cusField1" type="ns2:RemoteCustomFieldValue"/>
      </variables>
      <sequence name="Sequence1">
      <assign name="AssignNewIssue">
      <copy>
      <from>'probe'</from>
      <to>$cusField1/customfieldId</to>
      </copy>
      <copy>
      <from>'summary'</from>
      <to>$newIssue/summary</to>
      </copy>
      <copy>
      <from variable="cusField1"/>
      <to>$newIssue/customFieldValues[1]**</to>
      </copy>
      </assign>
      </sequence>
      </scope>
      <assign name="LoginAssign">
      <copy>
      <from>'test'</from>
      <to variable="LoginIn" part="in0"/>
      </copy>
      <copy>
      <from>'test'</from>
      <to variable="LoginIn" part="in1"/>
      </copy>
      </assign>
      <invoke name="loginJira" partnerLink="plJira" operation="login" portType="impl:JiraSoapService" inputVariable="LoginIn" outputVariable="Token"/>
      <assign name="IssueAssign">
      <copy>
      <from variable="newIssue"/>
      <to variable="CreateIssueIn" part="in1"/>
      </copy>
      <copy>
      <from variable="Token" part="loginReturn"/>
      <to variable="CreateIssueIn" part="in0"/>
      </copy>
      </assign>
      <invoke name="createIssue" partnerLink="plJira" operation="createIssue" xmlns:impl="http://localhost/rpc/soap/jirasoapservice-v2" portType="impl:JiraSoapService" inputVariable="CreateIssueIn" outputVariable="CreateIssueOut"/>
      </sequence>
      </process>


      None of the 3 ways work:
      <copy>
      <from variable="cusField1"/>
      <to>$newIssue/customFieldValues[1]/ns2:RemoteCustomFieldValue</to>
      </copy>
      <copy>
      <from variable="cusField1"/>
      <to>$newIssue/customFieldValues/impl:RemoteCustomFieldValue[1]</to>
      </copy>
      <copy>
      <from variable="cusField1"/>
      <to>$newIssue/customFieldValues[1]*</to>
      </copy>

      Any ideas, advice or suggestions ???

      Thanks,