Collocated Query and Inference Agents

The inference agent can process and enrich the event data, create concepts, modify concepts, and so on. The query agent can send events to the inference agent using a local channel.

Inference agent rules can process the data and send an event to the query agent (where another query is listening for that event), or send the event out of the node.

Tip:
Modifying concepts retrieved from a query agent
 The inference agent can modify concepts retrieved from a query agent using the following functions. Use the appropriate function for the type of cluster:

For Coherence clusters: Coherence.CacheLoadEntity(concept)

For TIBCO BusinessEvents DataGrid clusters:

Cluster.DataGrid.CacheLoadEntity(concept)

As with all actions that modify concepts, ensure that correct locking is used before executing the query.

The rule ExecuteSelectInQueryAgent, in the following example project demonstrates this technique:

BE_HOME/examples/event_stream_processing/CollocatedInferenceAndQuery

The collocated inference agent can use Cache OM or In Memory OM. Performance of In Memory OM systems is very high. However, the processing potential of Cache OM is greater because the inference agent has access to all the cache data as well as the data in memory. Choose the option that fits your needs.