20.7. Salience State Example: Rule "B to D"

rule "B to D"
    when
        State(name == "B", state == State.FINISHED )
        d : State(name == "D", state == State.NOTRUN )
    then
        System.out.println(d.getName() + " finished" );
        d.setState( State.FINISHED );
end
  • Rule "B to D" fires last, modifying object D to state FINISHED.
  • There are no more rules to execute and so the engine stops.