« SOA Suite 11g - api tricks part 2 - finding instances | Main | SOA Suite 11g - Transaction(s) & boundaries; Part One »

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);


TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mt/mt-tb.cgi/13230

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on August 8, 2009 1:56 PM.

The previous post in this blog was SOA Suite 11g - api tricks part 2 - finding instances.

The next post in this blog is SOA Suite 11g - Transaction(s) & boundaries; Part One.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle