Wednesday, February 18, 2026

Handle Fault in Synch process

Scenario: 

If a fault occurs then we need to store the fault message in DB also sent the same fault to the consumer for Sync Process.

->

In BPEL whenever we call the external services and that services are not available then we get remote/binding fault.

In our scenario we are calling DB to store data suppose DB is down then in that case we can handle the error by using catch/catchAll/throw activity.

Note: 

Throw

The throw activity provides one way to handle errors in a BPEL process by generating a fault.

throw activity in a BPEL process can throw any type of fault, including standard faults,

A fault thrown by a throw activity should be caught and handled in the BPEL process.

The throw activity has three elements: its name, the name of the fault, and the fault variable

Catch

defines a set of custom fault-handling activities that execute based on an optional fault name and/or fault variable. If the fault name is missing, then the catch intercepts all faults with the same type of fault data.

CatchAll

CatchAll fault handler that executes if a thrown fault is not caught by a  catch block.

 Catch all is a variant of catch. It does not specify a fault name or variable to catch.

Step 1: For custome error create catch block in your block, once u define define any system error like binding/remote fault also create variable faultVar. 

-> This variable will create runtime.wsdl 

Runtime Faults
<message name="RuntimeFaultMessage">
<part name="code" type="xsd:string"/> 
<part name="summary" type="xsd:string"/> 
<part name="detail" type="xsd:string"/> 
</message>

Step 2:
In assign activity assign code/detail/smmary value

Step3:
In same scope throw system errror.

step4: we can aso define same thing in catchAll block

No comments:

Post a Comment

SOA Overview Part-1

  Middleware It provides a mechanism for the process to interact with other processes running on multiple network machines. Advantages...