what is the difference between stateless session and stateful session in drools. I have gone through different document and found below
Stateless Session Any changes in the facts while executing rules is not made aware to the rule engine so if any rule is modified no other re-activation of rules will take place.
Stateful Session As any changes in facts is available to the rule engine so if a rule is modified for a particular fact, this change will re-activate all the rules and fire the rules that are build on modified fact.
can any one explain me the above difference with example.
I was trying to execute the below rules and found same result
rule "first rules"
when
m : Message( status == Message.HELLO , myMessage : message )
then
System.out.println("first Rule");
System.out.println( myMessage );
end
rule "second rules"
when
m : Message( status == Message.GOODBYE , myMessage : message )
then
System.out.println("second Rule");
System.out.println( myMessage );
end
rule "third rules"
when
m : Message( status == Message.GOODBYE , myMessage : message )
then
System.out.println( "third Rule" );
System.out.println( myMessage );
m.setMessage( "Hello " );
m.setStatus( Message.HELLO );
update(m);
end