Thursday, July 25, 2013

Composite Sensors and Composite Set Title

While working on EM console and handling huge number of instances, It get difficult to identify which instance belongs to which process  and then starts a tedious process of searching every instance to find the one which we are looking for JJ.

To reduce this burden we can implement below  solutions and save ourselves from long never ending search :
1)      Composite Sensors
2)      Composite Set Title


1) Composite Sensors:

Composite sensors provide a method for implementing track able fields on messages.

Note:  
1.You add sensors to the following components of a SOA composite application in the SOA Composite Editor:
·        Service or reference binding components
·        Service components such as a BPEL process or Oracle Mediator that have subscribed to business events

 2. It uses a run time table COMPOSITE_SENSOR_VALUE  to store the value of the sensor in DEV_SOAINFRA.

To Add Composite Sensors:

Let’s take an example where you have a BPEL process which insert Employee Information to DB. This is a web service which receive information from an external system and then do data manipulation to insert data into DB.

XSD:

Steps 1: Click on the External or Exposed service and select the option Composite sensor:


Step 2: Click on add and give it a name (this name will be visible in EM console).Once the name is given we have 3 options to choose from to create the sensor.

A)     If we select Variable then we can pass variable directly to this sensor:

B)     If we want to have some expressions then we can select expression :
C)     We can set properties too:
Step 3:  Create the sensors and deploy the BPEL Process to EM:
Step 4: Test Payload:

<ns1:EmployeeID>123</ns1:EmployeeID>
 <ns1:EmployeeName>Scott</ns1:EmployeeName>
 <ns1:EmployeeDOB>010190</ns1:EmployeeDOB>
 <ns1:EmployeePhone>12234</ns1:EmployeePhone>

Now go to EM console Instance tab and Click on AddField to search for the sensor:



Some restrictions on using composite sensors:
·        Functions can only be used with the payload. For example, XPath functions such as concat() and others cannot be used with properties.
·        Any composite sensor that uses expressions always captures values as strings. This action makes the search possible only with the like comparison operator. Also, even if the value is a number, you cannot use other logical operators such as <, >, =, and any combination of these.
·        Composite sensors only support two types of sensor actions: Enterprise Manager and JMS.
·        Header-based sensors are only supported for web service bindings.
·        Sensor actions for Oracle B2B, service data objects (SDOs), web services invocation framework (WSIF), and Oracle Business Activity Monitoring bindings are not supported.
·        Sensor values can only be one of the following types.
1.       The following scalar types:
§  STRING
§  NUMBER
§  DATE
§  DATE_TIME
2.       Complex XML elements
·        When creating an XPath expression for filtering, all functions that return a node set must be explicitly cast as a string:
         xpath20:upper-case(string($in.request/inp1:updateOrderStatus/inp1:orderStatus) ) = "PENDING"
·        Sensors can only be configured on service components that subscribe to business events. The option to configure sensors is not available if there are no subscribed business events associated with the service component.
·        Sensors cannot be configured on service components that publish business events.
·        Sensors based on business event headers are not allowed (only payloads are allowed).
·        PL/SQL subscriptions are not supported.


2) Composite Set Title function :


 Drag the function ora:setCompositeInstanceTitle() on the variable which needs to be set as Title.

Note: The variable which is used shall be type cased to string variable or else the setTitle won’t work.




The value of the variable which has been set title is displayed on Name tab.


When to use Composite sensor and when to use Composite set title:


The answer of this question is relative , completely based on the requirement. But a general thumb rule can be used.


A)      If your required can be full filled by searching 1 variable then Set title is an easy and effective solution. It can be achieved by a simple browser search.
B)      If your requirement needs to have search on multiple variables and on some complex logic then composite sensors are the only solutions.
 


No comments:

Post a Comment