In BPEL Assign activity if the xpath returns empty result then SelectionFailure RuntimeFault will be thrown by the engine.
The input2 is optional and somecases input2 element will not be available in the request payload.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sup="http://xmlns.oracle.com/Application1/SuppressSelectionFailure/SuppressSelectionFailure">
<soapenv:Header/>
<soapenv:Body>
<sup:process>
<sup:input>?</sup:input>
</sup:process>
</soapenv:Body>
</soapenv:Envelope>
While invoking the service I am getting the selectionFailure exception as shown below.
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<env:Fault>
<faultcode>env:Server</faultcode>
<faultstring>faultName: {{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure}
messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}</faultstring>
<faultactor/>
<detail>
<exception/>
</detail>
</env:Fault>
</env:Body>
</env:Envelope>
I want to suppress the selectionFailure exception because input2 is a optional element .
The ignoreMissingFromData attribute will help us to suppress the selectionFailure if the target is missing in the copy operation.
<copy bpelx:ignoreMissingFromData="yes|no"/>
The bpelx:insertMissingToData attribute will help us to suppress the selectionFailure if the target is missing in the copy operation.
<copy bpelx:insertMissingToData="yes|no"/>
If the xpath in the copy operations returns empty node for the target then we will be getting exception "The assign activity of the to node query is returning zero node"
Configure the attribute bpelx:insertMissingToData will help us to suppress this error. <copy bpelx:insertMissingToData="yes"> <from variable="inputVariable" part="payload" query="/client:process/client:input1"/> <to variable="outputVariable" part="payload" query="/client:processResponse/client:result1"/> </copy> The runtime will crate the to-spec element if it is missing and assign the source value(used Remove operation to remove the result1 element from outputVariable for testing). The attributes insertMissingToData and ignoreMissingFromData can be added by righ clicking the copy rules. |
Monday, March 23, 2015
Suppressing the Selection Failure exception in Assign activity – Oracle SOA
########
at 8:49 PM
Labels: SOA Suite 11g
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment