Signup/Sign In

Drools: Rule Consequence Keywords

Rule Consequence Keywords means the keywords which are used in the "then" part of the rule.

  1. Modify: The attributes of the fact can be modified in the then part of the Rule.

  2. Insert: Based on some condition if true, one can insert a new fact into the current session of the Rule Engine.

  3. Retract: If a particular condition is true in a Rule and you don't want to act anything else on that fact, you can retract the particular fact from the Rule Engine.

Note: It is considered very bad practise to have conditional logic(if statements) within rule consequence. Most of time, a new rule should be created.