Sunday, October 10, 2010

Integarting BAM with BPEL in SOA Suite 11g

 Hi Friends... In this box we will discuss how to integrate BAM and BPEL with a sample and simple example.
To do this we have to have SOA suite installed along with BAM.(And as usual JDev is required to do the design time development.)

We have two methods to integrate these two. One is with the help of BAM adapter and second one is through sensors.

First we will see the first approach.(with BAM adapter)

Start the Admin server, Managed server and BAM server before starting the development.
Now login to the BAM console.



Here we will see the BAM home page as below. Click on Active Viewer



Now create a data object by clicking on createdataObject link.



Provide the dataObject name and then click on add fields to add elements to the dataObject.



Now finish the creation of dataobject by clicking on createDataObject button.

In JDeveloper create a SOA project (with BPEL component and BPEL can be any type)
Open the composite.xml and drag the BAM adapter to the left swim plane.



Give appropriate name to the service. If you have already a connection to BAM server it will show that one otherwise create new connection by providing BAMserver deatils.
If we expand that connection, we can see the dataObject that we have created in BAMConsole in the previous steps as below.



Select the dataObject and select the operation (for our sample select insert) and NEXT



Now we are in JNDI Name page of configuration wizard. Here we have to provide the JNDI name that is configured in Weblogic Administartion console.



If it is not configured follow the below steps.
Open the administration console by providing the credentials.
Now select the  Deployments and then navigate to Oracle BAM Adapter by clicking next below the Deployments table.



Select configuration and then Outbound Connection pools. Now expand SOAPConnection factory and click on eis/bam/soap



Now it will open below page. Here provide the BAM server details. In the boxes after entering values we have to click enter explicitly.



After entering all values save the changes. After saving the changes we have to redeploy the BAMAdapter which it will show as below.



Now again come to deployments and then Oracle BAM Adapter. Select the checkbox corresponds to Oracle BAM Adapter, which will enables the update button above the table.



Click on the update button then select the redeploy radio button. If we are doing this first time for BAM adapter it will ask us to create Plan.xml. Give the appropriate name and finish the redeployment.

If we click on Oracle BAM adapter and then on General tab it will show a page as below. Make sure that you are providing the same JNDI name while configuring in JDeveloper.



Now in Jdeveloper finish the configuration of BAM adapter and assign required values to the input variable of BAM adapter invoke variable. After completion of these things our BPEL looks like below.



Like other adapters we will get one wsdl, one jca file and one xsd file for this adapter.

Now deploy the composite application and provide the inputs in the em page.



Now open the BAM console and select the dataobject in dataObject pane.



Now click on the contents link in the center area of the page.



We can see the the details as below.




This is the end of first method.

Now we will see the second approach.

In this methode first we have to create sensors and have to create BAM sensor action through which we interact with BAM.

To create sensors see this post.
After creating sensors create BAM sensor action as below.
In structure pane right click sensor actions then create and now select BAMSensor action.



Give name to the action and select the sensor in the dropdown list.



Now by clicking on the torch beside the data object select the object we have created in BAM console earlier.



Select the operation in the dropdown list and double click on each variable present in available key box to make them available. If we want we can change the XSL name otherwise accept the default. In Connection factory JNDI provide the JNDI name we configured above.(as shown in below image). Finish the BAM action creation



It will open XSL we mentioned while configuration. Map the elements as required. In the source side it will give standard structure from the XSD and in target side we will have elements that dataObject contains.



Deploy the composite application and see the results in BAM console.


Regards


PavanKumar.M.V.S.S.S..S

Sensors in SOA 11g

Hi All... in this topic we will see how can we define sensors and in how many ways we can use these sensors for different purposes.
We can create three types of sensors in BPEL.

1) Variable sensors ----Variable sensors are used to monitor variables(or parts of a variable) of a BPELprocess.

2) Fault sensors ---- Fault sensors are used to monitor BPEL faults.

3) Activity sensors ----Activity sensors are used to monitor the execution of activities within a BPEL process.

Once we create a sensor we can associate an action to it. When a sensor is triggered by Oracle BPEL Process Manager, a new sensor value for that sensor is created. After that, all the sensor actions associated with that sensor are performed. A sensor action typically persists the sensor value in a database or sends the normalized sensor value data to a JMS queue or topic. For integration with Oracle Business Activity Monitoring, the sensor value can sent to the BAM adapter.

When we create a sensor we will get below files
bpel_process_name_sensor.xml --- defines the sensor definitions of a BPEL process.


bpel_process_name_sensorAction.xml --- defines the sensor action definitions of a BPEL process.

Using sensors in BPEL:

Create a soa project with BPEL as component (can be any template empty, sync or async)
We will create variable, activity, fault sensors in order respectively.
Now open the bpel process and go to structure window, right click variablesensor and select create variable sensor as below.


Give a proper name to sensor and select the variable to which you want to create a sensor and finish the creation.
 

Now right click activity sensor and select create activity sensor as below.

 

Give a proper name to sensor and select the activity to which you want to create a sensor and finish the creation.

 

To create fault sensor right click fault and select create. Now provide the name and select the fault for which we want to create. (In this example we are going with selection failure) as below.

 


Now we are done with creation of sensors and we are about to create sensor actions.
For this right click sensor actins and select create and then sensor action.



Here give some name and select the publish type as Database.(we have other options, in this sample we are going with database. Infact in BPEL console we will see the sensors with action -publish type as database.)

Database: Publishes the sensor data to the reports schema in the database. The sensor data can then be queried using SQL.
JMS Queue: Publishes the sensor data to a JMS queue.
JMS Topic: Publishes sensor data to JMS topic.
Custom: Publishes the data to custom Java class.
JMS Adapter: Publishes to remote queues or topics. (Above JMS Queue and JMS Topic publish types only publishes to local JMS destinations)



Now in edit all the sensors we have cretaed above and select the sensor action thatwe created now as below.



To get the selection failure for fault sensor we are creating an assign activity as below.



Now deploy the composite application and initiate it from em page.



It will get faulted because of our assign activity.



Now open the instance and go to sensor values tab.



In sensor values page we can see the sensors for variable, activity and fault sensors with the values like in below pics.







Till now we have seen sensors in BPEL.

Along with the BPEL sensors we have one more sensors called COMPOSITE sensors which we create in composite.xml. We will see these sensors in coming post in detail.

Regards

PavanKumar.M.V.S.S.S.S