ECA Rule Condition
An ECA rule condition is either a database query, a logical expression, or a call to a subprogram (function or method) executing arbitrary code returning true or false. If database queries are employed, then a nonempty set is equivalent to true, and an empty set is equivalent to false.
A key issue of an ECA rule condition is that it ought to take parameters carried by the event triggering the rule that, in turn, evaluates the condition. The condition either returns a set (as a result of an SQL query) or a Boolean value (as a result of evaluation of the logical expression or the execution of the subprogram). An empty set is equal to false, and a nonempty set is equal to true. Another key issue is that results of the condition evaluation can be used to optimize rule action execution in many cases. Thus, there is a need to pass parameters from the condition evaluation to the rule action execution.