SOA Suite 11g - api part 3 - finding instances through composite sensor values

In the first two parts of the "API"-mini-story, I have shown how to use the API to find composites, display component states, invoke services and lastly find them back via CompositeInstanceFilter.

Another way of finding instances (just by UUID, that is conversation ID) is by querying composite sensor values - the guys that I talked about in this entry.

One of the sensors we declared was on the inbound service operation for BamOrderBookingComposite, and after firing yielded the following information:
-> Sensor: OrderProcessingStart data: Order 900.

So how to query by this info with the API? Create a sensor filter, set it on the composite instance filter, and use the good old Locator api.


List sFilterList = new ArrayList ();
SensorFilter sFilter =
new SensorFilter("OrderProcessingStart" /* sensorname */,
Sensor.SensorDataType.STRING /* type */,
Operator.EQUALS /* operator for comparison */,
"Order 900");
sFilterList.add(sFilter);

filter = new CompositeInstanceFilter();
filter.setSensorFilter(sFilterList);
filter.setCompositeDN(getOrderBookingCompositeUri(null));

obInstances = findCompositeLoc.getCompositeInstances(filter);
// we should find one instance
boolean foundInstance = false;
for (CompositeInstance instance : obInstances)
{
if (instance.getConversationId().equals(uuid))
{
foundInstance = true;
break;
}
}
if (!foundInstance)
throw new Exception ("Could not find composite instance with id: " +
uuid + " and sensorfilter: " + sFilter);


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips and tricks straight from the SOA / BPM development team at Oracle HQ

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today