-
Language:
English
-
Language:
English
20.5. Salience State Example: Rule "Bootstrap"
rule Bootstrap
when
a : State(name == "A", state == State.NOTRUN )
then
System.out.println(a.getName() + " finished" );
a.setState( State.FINISHED );
end
Result:
rule "A to B"
when
State(name == "A", state == State.FINISHED )
b : State(name == "B", state == State.NOTRUN )
then
System.out.println(b.getName() + " finished" );
b.setState( State.FINISHED );
end
- Every action and the corresponding changes appear in the Working Memory.
- The assertion of the State object A in the state
NOTRUNactivates theBootstraprule, while the assertions of the otherStateobjects have no immediate effect. - The execution of rule Bootstrap changes the state of A to
FINISHED, which, in turn, activates rule "A to B".