A fact is added to the rule network through the session, the approximate process of how to make a rule match is as follows
(1) Find the corresponding Entrypointnode object from the map collection of Entrypointnode by root node object
(2) The Entrypointnode object has a Objecttypenode map collection that transforms the fact class into Classobjecttype, which is found in the collection Objecttypenode
(3) The sink attribute of the Ojecttypenode object refers to the rule network of the fact fact
(4) Take a alphanode from the list in the sink attribute to match, recursively traverse all Alphanode subnodes (sink attribute) and compare the fact data according to the conditions in the Alphanode.
==> (the child node) is an attempt to match a rule completely, if there is a mismatch down, indicating that the rule does not conform to the current fact, exits the recursion, and begins to match to the right.
==> (Nextrighttuplesinknode property) starts trying to match another rule.
===> down (all the conditional patterns of the rule currently represented by the Alphanode child node), if all the hidden conditions in the child nodes Alphanode are met, then exactly matches a rule, forming the agenda to join the conflict collection, to match all the rules, The result part of the match rule is then executed according to the priority of the rule, and the fact data is changed.
===> to the right (another rule is matched), if all of the child nodes alphanode the hidden conditions are met, then exactly match a rule, forming an agenda to join the conflict collection, to match all the rules, and then according to the priority of the rule to perform the matching rule on the result part, Change the fact data.
Rete Network for simple rules of the Java Rules Engine