Special nodes in the network
So far we have covered the basic types of nodes present in PHREAK that allow us to create simple rules in Drools. But there are some others nodes with very specific behaviors that are used for some conditional elements we haven't discussed so far. This section will analyze the most commonly used of these conditional elements: not, e xists, accumulate, and from.
The Not Node
The not conditional element is the non-existential quantifier in Drools that checks for the absence of one or more patterns in the working memory.
Drools provides a specialized version of a Beta Node to implement the necessary logic of the not conditional element.
As an example, let's use the following rule:
rule "Sample Rule 1" when $c: Customer() ...
Get Mastering JBoss Drools 6 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.