Soa12c – How to locate a composite instance using title and sensors in EM

In a high-volume environment, it is not easy to go and find a  particular composite instance which processed a particular Order Id. We will see in this blog two ways in which we can locate a particular composite instance in Enterprise Manager. To locate a composite instance using wild card search see Wild Card Search post.

Enterprise manager allows instances to be searched based on “Name” field. So, populating “Name” field with Order Id is one way in which we can locate instances.  In 11g, setCompositeInstanceTitle did the job. However, in 12c, we need to use setFlowInstanceTitle to set the “Name” field in EM.

Let us create a sample SOA application. Following is a sample Order Schema.

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org"
            targetNamespace="http://www.example.org" elementFormDefault="qualified">
  <xsd:element name="Orders" type="OrdersType"/>
  
  <xsd:complexType name="OrdersType">
  <xsd:sequence>
    <xsd:element name="Order" type="OrderType"/>
  </xsd:sequence>
  </xsd:complexType>
  
  <xsd:complexType name="OrderType">
  <xsd:sequence>
    <xsd:element name="OrderId" type="xsd:string"/>
    <xsd:element name="Orderdate" type="xsd:dateTime" minOccurs="0" />
    <xsd:element name="CustId" type="xsd:string"/>
    <xsd:element name="Lines" type="LinesType" minOccurs="0" />
  </xsd:sequence>
  </xsd:complexType>
   
  <xsd:complexType name="LinesType">
  <xsd:sequence>
    <xsd:element name="lines" type="linetype" maxOccurs="unbounded"/>
  </xsd:sequence>
  </xsd:complexType> 
  
  <xsd:complexType name="linetype">
  <xsd:sequence>
    <xsd:element name="productid" type="xsd:string"/>
    <xsd:element name="quantity" type="xsd:int"/>
  </xsd:sequence>
  </xsd:complexType>
   
</xsd:schema>

Create a  SOA Project with a BPEL Component. Select Input as “Orders” element.

BPEL Process Options
BPEL Process Options

Create a dummy string variable in bpel process. This will be used in assignment statement.

Add an “Assign” activity and assign output of setFlowInstanceTitle to dummy string variable. Check “Method not found – SetFlowInstanceTitle” post, if JDeveloper shows warning for setFlowInstanceTitle function.

setFlowInstanceTitle
setFlowInstanceTitle

Deploy the project and run few tests with different order id, customer id as input. Order Id and customer id are the mandatory fields. Instances in EM console should have the value of OrderId in “Name” field.

Instance With Title In EM
Instance With Title In EM

Click on “Search Icon” and click “Add/Remove filters”. Select “FlowInstance” check box. This will add few more fields based on which search can be carried out.

Search Options
Search Options

Search/Locate Instances by giving values of OrderId in “InstanceName” field.

Search by Instance Name
Search by Instance Name

Search results will show the specific composite instance which processed given order id.

Above method of setting the “InstanceName” and searching by “InstanceName” in EM will help in identifying the specific instance.

Apart from finding by Order Id, if we need additional fields based on which instances has to be located (like by Customer Id), we can use “Composite Sensors”.  EM Console allows up to 6 Composite sensors to be used as search fields in  locating the instances.

Let us see  how to create a composite sensor and use that to search instances.

In JDeveloper, right click on “Service Entry Point” and select “Configure Sensors”.

Click plus icon to add a sensor. Provide a Name to the sensor.

In “Expressions”, select “Variables” and select “CustId”.

Create Composite Sensor
Create Composite Sensor

Redeploy your project. Sensors will be activated only for new instances. So, make few more tests with different order id and customer id. In the “Flow Trace” , composite sensors will be listed in “Composite Sensor Values” tab.

Go to Search options and search by Sensor name and Sensor value. Select “Sensor Name” from the lookup or we can type it in the box. By default “Equal” operator is used. For further option, click on lookup icon. Search results will show specific composite instance or list of composites instances which satisfies the given customer id.

Searching by Sensors
Searching by Sensors

Based on requirement we can create additional composite sensors to locate instances in EM Console. If we have more than one composite sensors in search criteria, logical AND is applied to the condition in locating instances.

8 thoughts on “Soa12c – How to locate a composite instance using title and sensors in EM

  1. Hi
    can you let me know the way to search any Instance Name with wild card like %ord% (show all ord after search) .I found that11g we are able to search based on wild card input but in 12c we can search only with full string.

    Please help.

    1. Hi Krishna,

      I have used ora:setCompositeInstanceTitle( “***”) in my BPEL in 12c.Any idea where can I find the column in soa-infra.

  2. Hi Krishna,

    Thanks for the nice article. we have used the setFlowInstanceTitle() from javaCallout activity. We have observed a strange behavior, Flow Name is displaying for some composites and not creating for some composites.

    Environment : Soa 12c (12.1.3) , Multi Node cluster.
    any suggestions to fix this issue?

    1. Hi Kishore
      Do you see the values in the backend “sca_flow_instance” table for those composites or do you see any exceptions in the log from java callout?
      May be you can try with an assign activity instead of JavaCallout in composites where you see this problem.

    2. Hi Krishna,

      Even i have the same issue and i am trying with Assign activity, sometimes able to see name for some instances and not able to see the name for most of the instances.Issue is not consistent.

      Could you please help me out on this.

      Thanks,
      Pradeep

  3. Any idea why Oracle broke this Name column population interface between 11g and 12c? This seemingly random change requires code modification in all existing composites, and I can not see a reason it would have been necessary to break the previous interface. Backward compatibility should be more respected unless there is an architecturally important reason to break it.

    Have not tried 12c search yet (because all my Name columns are now blank due to the API change), but the wild-card search on values in the name column in 11g (e.g. ‘%123’) was extremely useful to us (not all our EM user have direct access to the db).

Leave a Reply to Ranjit Cancel reply

Your email address will not be published. Required fields are marked *