SOA Suite 11g - api part 3 - finding instances through composite sensor values
By clemens.utschig on Aug 08, 2009
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.
sFilterList = new ArrayList ();
SensorFilter sFilter =
new SensorFilter("OrderProcessingStart" /* sensorname */,
Sensor.SensorDataType.STRING /* type */,
Operator.EQUALS /* operator for comparison */,
filter = new CompositeInstanceFilter();
obInstances = findCompositeLoc.getCompositeInstances(filter);
// we should find one instance
boolean foundInstance = false;
for (CompositeInstance instance : obInstances)
foundInstance = true;
throw new Exception ("Could not find composite instance with id: " +
uuid + " and sensorfilter: " + sFilter);