Sunday, 1 March 2020

Interview question for Error Handling--2

Catch & CatchAll block
Catch block
1. This is used to handle specific fault
2. Store fault information in fault variable
3. We can add more than one Catch block in one BPEL process.
CatchAll block
1. This is used to handle any type of fault.
2. We need to use functions to get the fault details.
3. We can add only on CatchAll block in one BPEL process.


Function we use to get Fault Name and Fault description in CatchAll block
We use

ora:getFaultName() to get fault name 
ora:getFaultAsString() function to get fault description 

Fault Handling framework
Oracle SOA Suite provides generic fault management framework to handle the faults. We use this framework to handle the fault that occur during invocation time.


Catch blocks and Fault Handling Framework
CatchAll Blocks
1. We use Catch & CatchAll block to handle all types of error.
2. These can be used only for BPEL component.
3. We can use this for all BPEL templates (Sync, Async, Oneway).


Fault Handling Framework

1. We use this framework only to handle invocation faults; we can’t use this framework to handle all types of fault.
2. This can be used for BPEL as well as Mediator component.
3. We should use this only for two BPEL templates (Async and OneWay).


Fault Handling Framework works:

Fault Handling Framework is based upon two files.


Fault-policy.xml: This file is used to define one or more fault policies with conditions and actions.


Fault-binding.xml: This file is used to associates a policy with a composite, component or reference.


All actions we have in fault-policy.xml file
1. Retry
2. Human Intervention
3. Terminate
4. Java call
5. replay
6. rethrow


How to handle errors in mediator component
We use fault handling framework to handle fault in mediator.


File rejection handler
File rejection handler is used to handle rejected file while performing polling.


Types of rejection handlers 
1. Web Service Handler
2. Custom Java handler
3. Queue handler
4. File Handler