Debugging the left-hand side of a rule
From all the different components of a KIE Base (rules, functions, globals, and so on), the most difficult one to debug/troubleshoot is the left-hand side of a rule.
Unlike the right-hand side of a rule, the left-hand side translation to Java is not straightforward. As we will see in the next chapter, a first glance of this was already introduced in Chapter 1, Rules Declarative Nature—the left-hand side of all the rules in a KIE Base is compiled into a network of nodes (which is also known as the PHREAK network). Inside this network, the relation between a pattern, or even conditions inside a pattern, and the individual rule that it belongs to can't be determined most of the time. A single pattern or condition in the PHREAK network could potentially be related to multiple rules.
While this network of nodes dramatically improves the evaluation time of our rules, it also makes potential errors more obscure and difficult to troubleshoot. The following sections...