Use salience or some other order to control the facts. But I think the key 
point to remember is that Drools isn't stable, given the same set of rules and 
the same set of input in the same order there is no guarantee that the rules 
will execute in the same order unless there is something in the rules which 
forces them to do so. 99.9% of the time the version you run will produce the 
same ordered output but perhaps 0.1% of the time it could occur in a different 
order.

This can lead to some nasty intermittent bugs if rules aren't written correctly 
and make implicit assumptions about the order they run.

My suspicion is this is due to some hash map/set buried deep in the code 
somewhere controlling the order of equal priority activations, but I've never 
managed to work out where this is (if my theory is even correct). It would be 
nice if it were changed to a version that produces a consistent ordering every 
time (given the exact same set of inputs).

Thomas

> -----Original Message-----
> From: [email protected] [mailto:rules-users-
> [email protected]] On Behalf Of Veera
> Sent: 09 February 2012 06:25
> To: [email protected]
> Subject: [rules-users] Drools Debugging
>
> Hi All,
>
> I have one doubt that is : When i compiling a sample HelloWorld Drools
> program it is printing output like :
> Hello World
> Goodbye cruel world
>
> and i added a simple rule like :
>  rule "test"
>     when
>         eval(true)
>     then
>         System.out.println( "Hello!!!" ); end
>
> When i compile the output is :
> Hello!!!
> Hello World
> Goodbye cruel world
>
> But when i debug it is showing output like:
> Hello World
> Goodbye cruel world
> Hello!!!
>
> Can anybody help me how to get the same output when i debug also...
>
> Regards,
> Veera
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Drools-
> Debugging-tp3728574p3728574.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users


**************************************************************************************
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
[email protected] and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**************************************************************************************

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to