3 Replies Latest reply: Jan 10, 2013 1:05 PM by 837919 RSS

    Problem with array param when calling a webservice from a BPM Process

    837919
      Hi. I have a web service and uses an array as parameter.

      The array (named "atributos") as part of a business object is defined here:

      <xs:schema targetNamespace="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/TrackPCPDOTrans" ...>
      <xs:complexType name="TrackPCPDOTransType">
      <xs:sequence>
      <xs:element name=... />
      ...
      <xs:element name="atributos" nillable="true" type="ns2:AtributosType" maxOccurs="unbounded"/>
      </xs:sequence>
      </xs:complexType>
      <xs:element name="TrackPCPDOTrans" type="TrackPCPDOTransType"/>
      </xs:schema>


      <xs:schema targetNamespace=... >
      <xs:complexType name="AtributosType">
      <xs:sequence>
      <xs:element name="key" nillable="true" type="xs:string"/>
      <xs:element name="value" nillable="true" type="xs:string"/>
      </xs:sequence>
      </xs:complexType>
      <xs:element name="Atributos" type="AtributosType"/>
      </xs:schema>

      In the service task activity, I pass the params to the web service:

      "descripcion" --> TrackPCPDOTrans.atributos[1].key
      DataObject.descripcion --> TrackPCPDOTrans.atributos[1].value
      "estado" --> TrackPCPDOTrans.atributos[2].key
      DataObject.estado --> TrackPCPDOTrans.atributos[2].value
      "justificacion" --> TrackPCPDOTrans.atributos[3].key
      DataObject.justificacion --> TrackPCPDOTrans.atributos[3].value

      But when I test the process, an error ocurrs:

      <auditQueryPayload auditId="8712004" ciKey="380019">
      <dataState>
      <dataObject name="FaultMessage" isBusinessIndicator="false">
      <value> oracle.bpm.bpmn.engine.model.runtime.microinstructions.TrappableException: faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure} messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} cause: {faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure} messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} parts: {{ summary=<summary>empty expression result. The expression bpmn:getDataInput('trackPCPDOTrans')/ns:atributos[2]/ns1:key is empty. An attempt to read or copy data referenced or computed by the XPath expression either had invalid data, according to the XML schema, or did not contain certain optional data. Ensure that the variable or expression result named in the error message is not empty. Enable XML schema validation of related data elements to ensure the run-time data is valid. </summary>} } </value>
      </dataObject>
      </dataState>
      </auditQueryPayload>

      What is wrong?
      Thanks for your help.
        • 1. Re: Problem with array param when calling a webservice from a BPM Process
          Daniel Atwood
          Don't know what your XSD looks like but perhaps this might help:

          Problem by inserting values into an Array

          Dan
          • 2. Re: Problem with array param when calling a webservice from a BPM Process
            837919
            I'll do some tests and then I tell you what happened. I was doing the parameters assignment directly in the Service Task and I think (as you suggest) it's a good idea to do it in a Script Task (using XML). Thank you very much!
            • 3. Re: Problem with array param when calling a webservice from a BPM Process
              837919
              I did the assignment in XPATH:

              oraext:parseXML(concat('<AtributosTracking xmlns="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/AtributosTracking">
              <arrayAtributosTracking>
              <key xmlns="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/Atributos">','descripcion','</key>
              <value xmlns="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/Atributos">',bpmn:getDataObject('DataObjectDDSAO')/ns:descripcion,'</value>
              </arrayAtributosTracking>
              <arrayAtributosTracking>
              <key xmlns="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/Atributos">','estado','</key>
              <value xmlns="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/Atributos">',bpmn:getDataObject('DataObjectDDSAO')/ns:estado,'</value>
              </arrayAtributosTracking>
              </AtributosTracking>'))


              AtributosTracking.xsd:

              <?xml version="1.0" encoding="UTF-8"?>
              <?bpmo version="11.1.1.6.0.15.53" build="15.53" fullName="DataTypes.AtributosTracking" modifiers="268435456"?>
              <xs:schema targetNamespace="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/AtributosTracking" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/AtributosTracking" xmlns:ns1="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/Atributos" xmlns:bpmo="http://xmlns.oracle.com/bpm/bpmobject/" >
              <xs:import namespace="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/Atributos" schemaLocation="Atributos.xsd"/>
              <xs:complexType name="AtributosTrackingType">
              <xs:sequence>
              <xs:element name="arrayAtributosTracking" nillable="true" type="ns1:AtributosType" maxOccurs="unbounded"/>
              </xs:sequence>
              </xs:complexType>
              <xs:element name="AtributosTracking" type="AtributosTrackingType"/>


              Atributos.xsd:

              <?xml version="1.0" encoding="UTF-8"?>
              <?bpmo version="11.1.1.6.0.15.53" build="15.53" fullName="DataTypes.Atributos" modifiers="0"?>
              <xs:schema targetNamespace="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/Atributos" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://xmlns.oracle.com/bpm/bpmobject/DataTypes/Atributos" xmlns:bpmo="http://xmlns.oracle.com/bpm/bpmobject/" >
              <xs:complexType name="AtributosType">
              <xs:sequence>
              <xs:element name="key" nillable="true" type="xs:string"/>
              <xs:element name="value" nillable="true" type="xs:string"/>
              </xs:sequence>
              </xs:complexType>
              <xs:element name="Atributos" type="AtributosType"/>
              </xs:schema>


              But a new error occurrs when I run the BPM process:

              <auditQueryPayload auditId="8724004" ciKey="380025">
              <dataState>
              <dataObject name="FaultMessage" isBusinessIndicator="false">
              <value> oracle.bpm.bpmn.engine.model.runtime.microinstructions.TrappableException:
              faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
              messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
              cause: {faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
              messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
              parts: {{ summary=<summary>XPath query string returns multiple nodes.
              The assign activity part and query bpmn:getDataObject('AtributosTracking')/ns:atributosTracking are returning multiple nodes.
              The assign activity part and query named in the error message returned multiple nodes. It should return single node.
              According to BPEL4WS specification 1.1 section 14.3, the assign activity part and query named in the error message should
              not return multiple nodes. Verify the part and xpath query named in the error message at line number -1 in the BPEL source. </summary>} } </value>
              </dataObject>
              </dataState>
              </auditQueryPayload>

              Any idea?
              Thanks

              Edited by: César on 10/01/2013 11:02 AM