Locking (and Loading) in Timeouts
When TIBCO BusinessEvents uses Cache OM in a multi-agent or concurrent RTC application, locking must be used to ensure data integrity. When cache-only cache mode is used, you must also load concepts as needed.
For state transitions, locking and loading is handled in the normal way: the event that triggers a transition has an event preprocessor, where the locking is set to protect the concept from being modified by another action.
In multi-agent application, one inference agent at a time processes the timeout event of state machines. Once the current agent is stopped, next agent in the cluster resumes the processing.
To validate/confirm if an agent handles the state timeouts, enable JMX using the CDD property be.engine.jmx.connector.port in the ProcessUnit tab, open JVisualVM or JConsole and connect to the agent. Check for entry schedulers in the MBean com.tibco.be. The entry is available only for the InferenceAgent which handles the StateTimeouts.
Timeouts, however, are essentially time events, and time events do not go through an event preprocessor.
For this special case, therefore, you must implement locking (and loading as required) in a different way. Use the function Cluster.registerStateMachineTimeoutCallback() to register a rule function that acts as a preprocessor for state machine (and state) timeouts. You would typically call Cluster.registerStateMachineTimeoutCallback() in a startup function.
The signature is as follows:
registerStateMachineTimeoutCallback(String entityURI, String ruleFunctionURI)
Where the entityURI is the URI of the state machine concept, and the ruleFunctionURI is the URI of the rule function that acts as a preprocessor.
See TIBCO BusinessEvents Architect’s Guide for details on this topic.