Query From a Rule (in an Inference Agent)
Queries can only run in a query agent. Rules can only run in an inference agent. In order for a rule to trigger a query to execute, the rule must send an event to the query agent. In order for the query results to be used in a rule, the query agent must send them in an event to an inference agent.
A rule in the inference agent sends an event to destination D1, including any necessary query parameters.
The query agent listens for messages on destination D1.
When event E1 arrives, an event preprocessor executes a query statement.
A query function collects results into event, E2 and sends it to destination D2.
The inference agent listens on destination D2.
When event E2 arrives, a rule in the inference agent collects the results from the event and processes them as needed.