Wednesday, September 25, 2019

SOA Suite 11g & 12c – Oracle BPEL Master and Detail process coordination using signals

We usually met many scenarios where we need to coordinate between Master and Detail (Child) process to achieve our objective.This coordination enables us to specify the tasks performed by a master BPEL process and its related detail BPEL processes. This is sometimes referred to as a parent and child relationship.

A real life example:
Suppose a customer is booking a flight through airline website, customer will choose date, destination & boarding location etc then finally make the payment to book that flight. In this case date, location etc information will go to airline and airline needs to validate customer credit card or other mode of payment from bank. Here airline will first send credit card information to Bank but first it needs to validate date, destination & other information, once it is validated then airline send message to Bank that verify credit card information and meanwhile airline will wait for the response from Bank unless it receive any response from Bank, it will not start further processing. Once response is received from Bank, airline will do the rest of processing and after that response Bank can complete their processing.
Potential coordination points are as follows:
·         The master process (Airline) must signal the detail processes (Bank) that airline validation is successful and to continue processing.
·         Detail process (Bank) must signal the master process (Airline) after credit card validation is complete.

Use cases:
Typical use cases for the signal pattern are situations where a master process can only proceed when detail processes have completed or at least reached a certain state (the master process should only send the email to the customer when the detail process has handed the order to the shipping department) or when a master process calls a detail process to start processing and then needs to do some additional work before the detail process(es) can continue to their next step (master process asks detail to start gathering quotes from car rental companies, than continues to establish the credit-worthiness of the customer and when that has been taken care of indicates to the detail process that it may continue processing).

Master Detail signal exchange
Implementation:
Step1: create a Master process.
Create a BPEL process service component. For this example, the process is
named MasterProcess.

Double click the MasterProcess BPEL process⇾In the Components window, expand Oracle Extensions⇾Signal⇾Drag a Signal activity into the designer.

Click the Signal activity to display its property fields in the Property Inspector or
double-click the Signal activity.
Name: Enter a name (for this example, contactDetailProcess).
Label:  Enter a label name (for this example,
beginDetailProcess). This label must match the receive
signal activity label you set in the detail process in Step 6.
To: Select details as the type of process to receive this signal.

Drag a Receive Signal activity into the designer.Double-click the Receive Signal activity.
Name: Enter a name (for this example, waitForDetailProcess).
Label: Enter a label name (for this example,
completeDetailProcess). This label must match the
signal activity label you set in the detail process in Step 10.
To: Select details


Step2: Create a Detail process
Create a second BPEL process service component. For this example, the
process is named DetailProcess.

Double-click the DetailProcess BPEL process⇾In the Components window, expand Oracle Extensions⇾Drag a Receive Signal activity into your BPEL process service component⇾Double-click the Receive Signal activity.
Name: Enter a name (for this example,
WaitForContactFromMasterProcess).
Label: Enter a label name (for this example,
beginDetailProcess). This label must match the signal
activity label you set in the master process in Step 6.
To: Select master as the type of process from which to receive the
signal.

Drag a Signal activity into the designer.Double-click the Signal activity.
Name: Enter a name (for this example, contactDetailProcess).
Label: Enter a label name (for this example,
completeDetailProcess). This label must match the
receive signal activity label you set in the master process in
Step 10.
To: Select master as the destination.


Step3: Create an invoke from Master to Detail process.

Return to the MasterProcess master process⇾In the Components window, expand BPEL Constructs⇾Drag an Invoke activity into your BPEL process service component⇾Double-click the Invoke activity⇾Select the DetailProcess BPEL process you created in Step 1 as the partner link⇾Select the Invoke as Detail check box.
Complete all remaining fields in the Invoke dialog, and click OK
If this is an environment in which one master process is interacting with multiple
detail processes, perform the following tasks:
Specify the bpelx:detailLabel attribute for correlating with the receive
signal activity:
    <invoke name="Invoke_DetailProcess" partnerLink="DetailProcess.detailprocess_client" portType="ns1:DetailProcess"
            operation="process" inputVariable="Invoke_DetailProcess_process_InputVariable" bpelx:invokeAsDetail="yes"
            bpelx:detailLabel="completeDetailProcess"/>


Testing:
You can see Master process is waiting to get the signal from Detail process.
Detail process is waiting for the 2 minutes wait.
After 2 mins wait, Master process gets signal from Detail process.
Detail Process completion stage



Monday, September 23, 2019

12c SOA - Create a data source and outbound connection pool

Go to Service⇾Data Sources.
In configuration tab select newgeneric Data Source.
 Enter the name and JNDI name and click next.
 Select the database drivernext.
 It will show this, click next
Fill the details and click next
It will give this page. Now click test configuration, if success then you will get the above message. It means you are testing the connection directly with DB. Then click next
Now select the cluster that you want. Click finish.
Data source created successfully. Now click the data source to test it.
It will open this window, click monitoring tab.
Now select a server in this case osb_server1⇾est data source. It means you are testing this connection with server and DB You will get a success message.
 Creating outbound connection pool
Click deployments.

Click the adapter for which you want to configure outbound connection pool.
Select the configuration tab.
Now under outbound connection pool click New button to create a new connection.

Select javax.resource.cci.ConnectionFactory and click next.


Enter the JNDI name and click finish
Then check if it is created and click it .
Now enter the JDBC⇾press enter and then save.
Now Go to the deployments again and select the DBAdapter and update the DB adapter plan.xml.

12c SOA - Configure OSB SMTP Server

SMTP Server creation steps:
All projects⇾System⇾SMTP Servers⇾Right click on it⇾create⇾Create SMTP Server



Activate

 Testing through creating an Email Project:








Activate and start the testing




Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...