Control Statements

You can place ruleset control statements in the postlude of a rule.

last

The last stops ruleset execution after the current rule.

This example will stop execution of the ruleset if the rule that this postlude is contained in fires.

fired { 
  last 
} 

This example will stop execution of the ruleset if the rule that this postlude is contained in fires and x is equal to 4.

fired {
 last if(x==4)
} 

The following construct ensures that no rules below the current rule will ever be executed:

always {
 last 
} 

The last control statement is used in the authorize-then-use pattern.

Copyright Picolabs | Licensed under Creative Commons.