Information Technology Reference
In-Depth Information
What is a rule?
The first thing we need to define in a clear manner before proceeding is what rules are. A
rule , from the rule engine's perspective, is a constraint within a particular domain that will
evaluate to true or false. When specific components within the domain evaluate the con-
straint of a specific rule to be true, we say that the particular rule is activated. When activ-
ated rules are fired (an operation that is usually separated from the activation of a rule), a
particular action—specified within the rule—will be taken. Depending on the syntax, a rule
structure can vary from implementation to implementation. However, the general structure
of a rule will always be similar to the following code:
rule "rule name"
/* optional rule attributes */
when
/* a specific set of constraints in our domain */
then
/* a specific set of actions to be taken when
the constraints evaluate to true */
end
A single rule by itself doesn't provide much value to describe a complex decision. Never-
theless, a group of (many) rules will be far more descriptive. The rule engine responsibility
is to evaluate all rules together for a group of objects in the most efficient way possible.
A business process can invoke groups of rules to make complex decisions in specific parts
of its execution. At the same time, a rule can have specific actions that start, signal, or in-
teract in some way with an existing process instance. This integration between rules and
processes is managed in a special way with jBPM6, which we will discuss in the next sec-
tion.
Search WWH ::




Custom Search