Thursday, 14 November 2013

Composite Sensors in Soa 11g



                 In this blog ,I want to discuss about Composite Sensors.Composite sensors provide a method for implementing trackable fields on messages. Composite sensors enable you to perform the following tasks:

  •     Monitor incoming and outgoing messages.
  •     Specify composite sensor details in the search utility of the Instances page of a SOA composite application in Oracle Enterprise Manager Fusion Middleware Control. This action enables you to locate a particular instance.
  •     Publish JMS data computed from incoming and outgoing messages.
  •     Track composite instances initiated through business event subscriptions.

You define composite sensors on service and reference binding components or on service components that have business event subscriptions in Oracle JDeveloper. This functionality is similar to variable sensors in BPEL processes. During runtime, composite sensor data is persisted in the database.


In our case we Use the project we developed for  "Implementing Timeouts in Bpel Using Pick"

Let me remind you the xsd we used  

picksample.xsd
 <xsd:element name="EmployeeDetails">
<xsd:complexType>
<xsd:sequence>
 <xsd:element name="EmpID" type="xsd:string" />
  <xsd:element name="Salary" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="EmpdetailsResponse">
<xsd:complexType>
<xsd:sequence>
 <xsd:element name="EmpID" type="xsd:string" />
 <xsd:element name="MessageStatus1" type="xsd:string" />
 <xsd:element name="MessageStatus2" type="xsd:string" />

</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Step1: To create sensors ,Click the Composite Sensor icon above the SOA Composite Editor

Step2: Composite sensors window will pop up.Click on "+" icon to create composite sensor.

Step3: In the next window, give the name to sensor and define expression to assingn  value to this sensor.




Step4: You will see the input payload only inand out our usecase as our BPEL process is Synchronous .Drill down to EmpID and click OK.


Step5: Now under sensor actions you will see two options Enterprise Manager and JMS Queue.
  • Enterprise Manager
Select to make runtime sensor data searchable in the Instances tab of a SOA composite application in Oracle Enterprise Manager Fusion Middleware Control.
  • JMS Queue
Select to store composite sensor data (XML payload) in a JMS queue. You must specify the JMS connection factory and queue name.In our case we will use Enterprise Manager

Step6:Our Composite sensor "EmployeeSensor" is created .Click OK.
 Step7: Under your projects on left hand side you can see two new files getting created sensor.xml and sensorActiuon.xml. These files contains list of all the sensors configured for particular composite and along with their actions.

 Step8: Compile and deploy your code to EM and test the Sensors composite from EM

Step9: Now Open up flow trace for the request you triggered.Expand the sensors tab just below Flow Trace.You will see EmployeeSensor as sensor and its value that we passed in the input.



Step10: Go back to your Composite in EM and go to Instances tab.Just next to Search,Reset Buttons you will see a new button :AddFields. Click on that and select EmployeeSensor.



Step11: New search field "EmployeeID" will be added in the Search box along with all other existing search criterias.In this way you can search your instances by passing "EmployeeSensor" field value.


Composite sensors are very important from support and operations point of view as we can set custom search fields using which we can search for our composite instances.

Till now we have seen sensors in Composite.xml

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


For more Information Check the Below  Sensors


                                                                                                           by DeepthiReddy

No comments:

Post a Comment