Apama 10.15.1 | Developing Apama Applications | Developing Apama Applications in EPL | Defining Queries | Restrictions in queries
 
Restrictions in queries
There are some EPL elements that are appropriate for monitors but not queries, for example spawn and die. This is because queries scale automatically, with multiple threads of execution processing the events for different partitions as and when they arrive. Hence, within query code, the spawn and die operations are meaningless. Queries operate on the events in their windows and do not need to set up event listeners, stream queries, or stream listeners. Also, queries cannot subscribe to receive events sent to particular channels.
The following EPL features cannot be used in queries:
*Event listeners, that is, on statements
*Stream queries and stream listeners
*spawn and spawn...to statements
*die statements
*monitor.subscribe() and monitor.unsubscribe()
*An identifier cannot start with two consecutive underscore characters. For example, __MyEvent is an invalid event type name in a query (it is valid in a monitor). A single underscore at the beginning of an identifier is valid.
*Predefined self variable
Of course, you cannot call an action on an event when that action uses a restricted feature listed here.
The recommended means to send events from queries to monitors is by sending to a channel. See Generating events with the send statement.
The debugger does not support debugging query execution - it is not possible to set breakpoints in a query file. Use of the debugger can also affect how quickly queries are ready to respond to events, and should not be used in a production system (where it would cause significant pauses of the correlator).
Note: 
Several restrictions are enforced on queries if a license file cannot be found while the correlator is running. See Running Apama without a license file.