Thursday, October 17, 2013

Bpel Flow Activity For Parellel Process.


Pareller But Sequential using Flow activity :)

When we need to build a composite bpel service where we need to invoke several services in parallel for performance reasons we need to use Flow activity.  Branches in flow, flowN, and forEach activities are executed serially in a single thread (that is, the Nth branch is executed only after N-1 execution has completed). Execution is not completely parallel. This is because the branches do not execute in concurrent threads in this mode. Instead, one thread starts executing a flow branch until it reaches a blocking activity (for example, an synchronous invoke). At this point, a new thread is created that starts executing the other branch, and the process continues. This creates the impression that the flow branches are executing in parallel. In this mode, however, if the flow branches do not define a blocking activity, the branches still execute serially.


Parellel and Purely Parrelel using Flow:

First, you should go ahead and implement your flow with as many branches as required each with a service invocation.  You should then have a process that looks similar to the one below. 
To execute these invocations in parallel, double click on each partner link on the right side of the BPEL process.  Go to Properties and add a new property.  Select nonBlockingInvoke from the list and set the value to true.

Below link has an example for combination of Invoking Asynchronus webservice in parellel way by using Flow and Pick activity.
http://sathyam-soa.blogspot.in/2013/10/learner-series-oracle-bpel-receive-pick.html


Tuesday, October 15, 2013

Oracle SOA Transaction in BPel and Mediator

Oracle SOA Transaction in BPel and Mediator:

Oracle SOA Transaction in BPel and Mediator:

BPel:
Transaction in BPel is depends on the idemponent value of invoke activity.
If the idemponent value is set to false then new transaction is created after that invoke. Also dehydrate the invoke idemponent false activity. Point to be noted here is all the resources which are getting used is binded with XA transaction. If resources are binded with XA transaction something like webservice then we need to use compensating transactions



Mediator:
Transaction in mediator uses the existing transaction from the callee if the transaction exist else it will create a new transaction.

Syn Routing
In case of sync routing rules, they will be all executed in the same transaction, and if an error occurs, a rollback will be issued.

Note: in this case even a fault policy that is configured against a mediator fault will NOT trigger.

Explanation for Fault Policy not getting triggered:
In below scenario there are three invoke activities, in syn routing all are under one transaction. If second invoke fails then both invoke 1 and 2 is rolled back.  Concidered fault policy is written to retry when remote fault occurs. If fault policy is triggered then retry will be happening only for Invoke 2 but Invoke 1 is already rolled back hence fault policy is not triggered during synch routing.

Invoke 1

Invoke 2 ---> Exception (RemoteFault)

Invoke 3

 
Asynch Routing:
In case of async routing rules, each rule will be executed in a new transaction, and if errors occur, a rollback will happen, and a fault policy can be configured to react to it.


Refence:
http://www.oracle.com/technetwork/articles/soa/wli-bpel-transactions-088255.html
https://blogs.oracle.com/soabpm/entry/soa_suite_11g_-_transactions_b

Dehydration Process

Dehydration Process:
 
Dehydration is persisting the transaction in DB. This will be used as a point from which the Bpel Manager to retry the process. If there are three invoke point in a process if system restared in second invoke point and if its dehydrated then during rerunn of the instance process will start from third process instead of rerunning the first two invoke.
 
Durable processes incur one or more dehydration points in the database during execution. Dehydration is triggered by one of the following activities:
 
  • Receive activity
  • OnMessage branch in a pick activity
  • OnAlarm branch in a pick activity
  • Wait activity
  • Reply activity
  • checkPoint() within a <bpelx:exec> activity

Sunday, October 13, 2013