concept condition in category jboss

appears as: condition, conditions, The conditions, conditions, CONDITION
Effective Business Process Management with JBoss BPM

This is an excerpt from Manning's book Effective Business Process Management with JBoss BPM.

Business rules are applied based on a condition that has to be met, and when that condition is met the rule triggers an action. Rules are evaluated one-by-one, and they are either triggered or not. Rules can be grouped together, but they are still evaluated one-by-one to determine if a rule has a condition that is met that causes its action to be executed.

The easiest way to think about a rule is that there is a premise and a conclusion. The premise is the set of one or more conditions and the conclusion is one or more actions that will take place.

Now all these rules with LHS and RHS will need some sort of brain or engine to process the matching of facts to their conditions. This process uses an Inference Engine, the brain behind our rule processing system within JBoss BPM Suite. This inference engine matches facts to conditions in your rules and when they match, those rules are fired. Fired rules execute the actions contained within, which will either perform some action external to the application or it will modify one or more facts within your system. Figure 5.3 shows you an architectural overview of the inference engine as it is used in JBoss BPM Suite.

Figure 5.3. The inference engine in architecture used by JBoss BPM Suite.

The rules are loaded into production memory and the facts are put into working memory. Production memory does not change, but working memory is constantly being updated when facts are added, removed or modified as rules are fired. The pattern matcher is at the center of the inference engine and does pattern matching to find rules with conditions that can be met. When the conditions are met, the rule is added to an agenda, which is a listing of the actions to be fired. Once all the pattern matching is done and the agenda is complete, the rules on the agenda will fired one at a time. Figure 5.4 illustrates this process and the order of execution. If a rule firing causes any change in the facts in working memory, the agenda will be erased and the pattern matching starts all over building a new agenda based on the new facts being applied to the same rules. This continues until there are no more conditions being met and the agenda is empty.

[when]SENTENCE=CONDITION SENTENCE: There is a Person with CONDITION: $p : Person()