package reactive;
declare Person
@propertyReactive
name : String
age : int
weight : int
city : String
end
This is a simple all-DRL test case demonstrating that property reactive
may cause pending activations to be removed, depending on some
specific composition of the LHS.
* As the DRL is, only one rule fires but both should.
* Adding the Integer pattern (in either form) in both rules may result in
both rules firing, or only one, but both should.
Best
-W
rule kickoff
salience 100
when
then
Person p = new Person( "Joe", 20, 20, "Boston" );
insert( p );
insert( new Integer(1000) );
end
rule "y"
when
$p : Person(name == "Joe" )
// $o : Integer( intValue == 1000)
// $o : Integer()
then
modify($p){
setAge( 100 )
}
end
rule "x"
when
$p : Person(name == "Joe" )
// $o : Integer( intValue == 1000)
// $o : Integer()
then
modify($p){
setWeight( 100 )
}
end
rule z
salience -100
when
$p : Person()
then
System.out.println( $p );
end
// End