Oracle OSB-SOA-BPEL Interview Question and Answer – Part 11

In this article, we will discuss interview question with their justification on Oracle OSB, SOA and BPEL

This is part-11 of Oracle OSB-SOA-BPEL interview question series

Q) What is the use of Scope Activity ?

  • Scope activity is being used as a container for other activities
  • Within the scope you can manage fault handling, compensation, variable declaration, correlation etc…
  • When you build, or design your process, you need to consider a use of a scope activity.
  • For example: You need to design a process that calls java class and a web service (or other 2 operations). You can:
    1. Use 1 scope that contains both calls. That way, if you will have an error for either one of the services, you can catch it, and do something, like terminate the process.
    2. Use 1 scope for each service call. That way, if you will have an error for either one of the services, you can catch it, and continue to the next process step (scope or other activity)
  • Also, within a scope you can declare an operation that Replay the scope. That way, if something happens -> begin the scope (and its activities) from the beginning.
    There are many ways and purposes to use a scope. Again, it depends what is your requirement
  • One important thing to consider – scope can influence on performance (just to be aware of)

Note: Scope is similar to Stage activity in OSB, where it can contains actions inside stage. Similarly, scope contains other BPEL activities

Q) What is the use of Replay Activity ?

  • There is a function (bpelx:replay) that you can use in a throw activity or a Replay activity (depend of your SOA version)
  • When you are using this activity, the scope is starting all over again (you will actually throwing a fault)
  • For example – You have a scope that contains the following activities: assign, invoke, transformation, Replay. When your flow hits the Replay activity, it goes to the beginning (assign activity) and start all over. In that case forever, you can add some condition/s to determine when to use or not the Replay activity
  • One important note: The Replay activity/function acts as a Fault, so if you will add a catchAll to that scope, it will catch the Replay fault and will not continue

Q) What are the different adapters that can be used with BPEL ?

  • JMS/AQ adapter
  • Database adapter
  • File/FTP adapter
  • Oracle application adapter (OA)
  • Socket adapter

Q) What is a throw activity? What it is ?

  • Throw activity will explicitly throw the fault and this fault will get caught by the catch block and the corresponding actions will get executed

Q) How do you handle the faults in BPEL and what is throw activity ?

  • Using throw activity, you can throw business faults & within scope created you can catch this faults and redirect to the caller (consumer) to take action
  • Instead of the above approach you throw the same fault caught in catch activity of the scope created and then in main scope you can catch this fault using catchall activity

Q) How the fault handling is taken care of, in BPEL 11g ?
Q) What are those 2 xml files that will be used in this fault handling ?

  • fault-policies and fault-binding

Q) Explain error handling in BPEL and what is an error handling framework ?
Q) How does an error handling framework better than simple error handling in BPEL ?

  • EHF –Whenever any error thrown by the BPEL process/Mediator then EHF will check whether exist in Fault-Bindings.xml files and if so then the action in the Fault-Policy.xml file will be taken and if the action is not found then the fault will the thrown and it will be handled in the catch block

Q) How do we resubmit a faulted process ?

  • Scenario A: The BPEL code uses a fault-policy and a fault is handled using the “ora-human-intervention” activity, then the fault is marked as Recoverable and the instance state is set to “Running”
  • Scenario B: The BPEL code uses a fault-policy and a fault is caught and re-thrown using the “ora-rethrow-fault” action, then the fault is marked as Recoverable and the instance state is set to “Faulted”; provided the fault is a recoverable one (like URL was not available)

Q) Explain fault management Framework in BPEL ?

Fault management framework is kept inside a SOA Composite; when invoke activity fails getting a remote or binding fault, we can do some actions like retry,  re-throw, abort, replay scope and human intervention which helps in running the instance further rather than getting faulted

  • retry
  • re-throw
  • abort
  • replay scope
  • human intervention

Fault-handlers like catch and catchall are inside a BPEL to catch all faults, but fault policies will only be executed when an invoke activity fails

So the best practice is to have fault policies if business requires and at all times make sure you have the catch and catchAll branches and do the necessary compensation logic if required

 

Folks, it’s your turn to comment & suggest for improvement

Note: We have taken inputs from various folks and other weblog for making this comprehensive set of Oracle SOA-OSB interview & answers

 

Read Also:

 

Happy Coding !!
Happy Learning !!

Oracle OSB-SOA-BPEL Interview Question and Answer - Part 12
Oracle OSB-SOA-BPEL Interview Question and Answer - Part 10