bpmn:getDataObject error in Oracle BPM process instance

Our Oracle BPM (11.1.1.6) process uses a process Data Object (DO) which is enriched with data during it’s process lifetime. The DO is based on a Business Object (BO) which is a relatively large, but simple XSD data model.

A strange thing that occured was that when we started using Service Call & Script Task to enrich the data during the response our process got suspended.

Instance error on Service task:

instanceError_ServiceCall

And instance error on the Script task:

instanceError_ScriptTask

Checking the output (logging & instance suspended messsage) we noticed this error:
 


<auditQueryPayload auditId="316002" ciKey="200007">
<dataState>
<dataObject name="DO_myData" isBusinessIndicator="false">
<value>
<myElement xmlns="<a href="http://xmlns.oracle.com/xsd/BO_myData">http://xmlns.oracle.com/xsd/BO_myData</a>">
....
</myElement>
</value>
</dataObject>
<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:getDataObject('DO_myData')/ns:myElement/ns:myElement2 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>

Our output data association is configured with a simple express Copy command, but when we check the BPMN process file source we can see where the bpmn:getDataObject is used.

 


<sourceRef>myWebserviceResponseElement</sourceRef>
<targetRef>DO_myData</targetRef>
<assignment>
<extensionElements>
<ns5:OracleExtensions>
<ns5:DataAssignment operation="copy"/>
</ns5:OracleExtensions>
</extensionElements>
<from xsi:type="tFormalExpression" language="<a href="http://www.w3.org/1999/XPath">http://www.w3.org/1999/XPath</a>" xmlns:ns="<a href="http://xmlns.oracle.com/myApplication/myNamespace">http://xmlns.oracle.com/myApplication/myNamespace</a>" xmlns:bpmn="<a href="http://www.omg.org/bpmn20">bpmn:getDataOutput('myWebserviceResponseElement')/ns:myElement/ns:myElement2">http://www.omg.org/bpmn20">bpmn:getDataOutput('myWebserviceResponseElement')/ns:myElement/ns:myElement2</a>
<extensionElements>
<ns5:OracleExtensions>
<ns5:Expression mode="simple"/>
</ns5:OracleExtensions>
</extensionElements>
</from>
<to xsi:type="tFormalExpression" language="<a href="http://www.w3.org/1999/XPath">http://www.w3.org/1999/XPath</a>" xmlns:ns="<a href="http://xmlns.oracle.com/xsd/BO_myData">http://xmlns.oracle.com/xsd/BO_myData</a>" xmlns:bpmn="<a href="http://www.omg.org/bpmn20">bpmn:getDataObject('DO_myData')/ns:myElement/ns:myElement2">http://www.omg.org/bpmn20">bpmn:getDataObject('DO_myData')/ns:myElement/ns:myElement2</a>
<extensionElements>
<ns5:OracleExtensions>
<ns5:Expression mode="simple"/>
</ns5:OracleExtensions>
</extensionElements>
</to>
</assignment>

 

So however when using a simple copy in the output Data Associations, the project generates the code above where BPM is apparantly perfoming a getDataObject XPath BPM Extension Functions on the target element before mapping the data. Since the element is still empty (and not existing) in the current state of our process we seem to receive this error.

The solution seems simple to fix with an XSLT mapping, however we are still not sure if this is the way to go.

mapping

Using a XSLT transformation on the full Data Object does the trick. However this becomes a lot of work if you just need to map 1 element.

Still a thing bothering me is that the problem suddenly appeared on an script task outout mapping (where we always used Copy there) after some serious data modelling actions we performed on our BO. So I’m thinking that XML data modelling options as nillable, occurence, etc might have something to do with it. Still something requiring more research I guess.

Done all the development and writing together with Jan van Zoggel from rubiX. A similar post can be found on Jan’s Middleware blog site.

2 Comments

  1. Marcel van de Glind September 18, 2013
  2. Joe A. August 30, 2013