Re: [rules-users] Drools firing wrong rules

2011-07-11 Thread Edson Tirelli
   It is not possible to know, looking only at the screenshots that you
sent, what is the problem. Are the values null at the time you insert them
into the session? If you modify them after inserting them into the session,
are you properly notifying the engine?

   Edson


2011/7/11 pamerida 

> Hi everyone,
> I have a couple of rules, I just want to show a message when one of the
> fields is null and heres my code:
>
> 21. |   rule 'rule1'
> 22. |   salience 9990
> 23. |   when
> 24. |   Cuscar(bgm.size > 0 && bgm[0].c1001== null );
> 25. |   then
> 26. |   logger.log("Rule 1 activated");
> 27. |
> 28. |   end
> 29. |
> 30. |   rule 'rule2'
> 31. |   salience 9970
> 32. |   when
> 33. |   Cuscar(bgm.size > 0 && bgm[0].c1004== null );
> 34. |   then
> 35. |   logger.log("Rule 2 activated");
> 36. |
> 37. |   end
>
> And here's the result:
>
> Scenario #1
>
> http://drools.46999.n3.nabble.com/file/n3160376/debug2.jpg
> with this values when I call fire all rules I dont get any message (its ok
> because none of the elements is null)
>
> Scenario #2
> http://drools.46999.n3.nabble.com/file/n3160376/debug1.jpg
>
> with this values when I call fire all rules both rules are fired so i get
> both messages "Rule 1 activated" and "Rule 2 activated" (Incorrect - it
> should only fire rule number 1 cause only the element c1001 is null)
>
> Scenario #3
> http://drools.46999.n3.nabble.com/file/n3160376/debug3.jpg
>
> with this values when I call fire all rules I dont get any message
> (Incorrect - it should activate rule number 2)
>
> This is my model:
>
> http://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar
> rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar
>
> Can anybody help me please?, I dont know what am I doing wrong, thank you
> very much :) 
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160376.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools firing wrong rules

2011-07-11 Thread Mauricio Salatino
Yes that's right.. can you share some tests to see how you are inserting the
facts?

2011/7/11 Edson Tirelli 

>
>It is not possible to know, looking only at the screenshots that you
> sent, what is the problem. Are the values null at the time you insert them
> into the session? If you modify them after inserting them into the session,
> are you properly notifying the engine?
>
>Edson
>
>
> 2011/7/11 pamerida 
>
>> Hi everyone,
>> I have a couple of rules, I just want to show a message when one of the
>> fields is null and heres my code:
>>
>> 21. |   rule 'rule1'
>> 22. |   salience 9990
>> 23. |   when
>> 24. |   Cuscar(bgm.size > 0 && bgm[0].c1001== null );
>> 25. |   then
>> 26. |   logger.log("Rule 1 activated");
>> 27. |
>> 28. |   end
>> 29. |
>> 30. |   rule 'rule2'
>> 31. |   salience 9970
>> 32. |   when
>> 33. |   Cuscar(bgm.size > 0 && bgm[0].c1004== null );
>> 34. |   then
>> 35. |   logger.log("Rule 2 activated");
>> 36. |
>> 37. |   end
>>
>> And here's the result:
>>
>> Scenario #1
>>
>> http://drools.46999.n3.nabble.com/file/n3160376/debug2.jpg
>> with this values when I call fire all rules I dont get any message (its ok
>> because none of the elements is null)
>>
>> Scenario #2
>> http://drools.46999.n3.nabble.com/file/n3160376/debug1.jpg
>>
>> with this values when I call fire all rules both rules are fired so i get
>> both messages "Rule 1 activated" and "Rule 2 activated" (Incorrect - it
>> should only fire rule number 1 cause only the element c1001 is null)
>>
>> Scenario #3
>> http://drools.46999.n3.nabble.com/file/n3160376/debug3.jpg
>>
>> with this values when I call fire all rules I dont get any message
>> (Incorrect - it should activate rule number 2)
>>
>> This is my model:
>>
>> http://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar
>> rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar
>>
>> Can anybody help me please?, I dont know what am I doing wrong, thank you
>> very much :) 
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160376.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>   Edson Tirelli
>   JBoss Drools Core Development
>   JBoss by Red Hat @ www.jboss.com
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools firing wrong rules

2011-07-11 Thread Mark Proctor

On 11/07/2011 23:47, Mauricio Salatino wrote:
Yes that's right.. can you share some tests to see how you are 
inserting the facts?

and make sure it's drools 5.2

Mark


2011/7/11 Edson Tirelli >



   It is not possible to know, looking only at the screenshots
that you sent, what is the problem. Are the values null at the
time you insert them into the session? If you modify them after
inserting them into the session, are you properly notifying the
engine?

   Edson


2011/7/11 pamerida mailto:elp...@hotmail.com>>

Hi everyone,
I have a couple of rules, I just want to show a message when
one of the
fields is null and heres my code:

21. |   rule 'rule1'
22. |   salience 9990
23. |   when
24. |   Cuscar(bgm.size > 0 && bgm[0].c1001== null );
25. |   then
26. |   logger.log("Rule 1 activated");
27. |
28. |   end
29. |
30. |   rule 'rule2'
31. |   salience 9970
32. |   when
33. |   Cuscar(bgm.size > 0 && bgm[0].c1004== null );
34. |   then
35. |   logger.log("Rule 2 activated");
36. |
37. |   end

And here's the result:

Scenario #1

http://drools.46999.n3.nabble.com/file/n3160376/debug2.jpg
with this values when I call fire all rules I dont get any
message (its ok
because none of the elements is null)

Scenario #2
http://drools.46999.n3.nabble.com/file/n3160376/debug1.jpg

with this values when I call fire all rules both rules are
fired so i get
both messages "Rule 1 activated" and "Rule 2 activated"
(Incorrect - it
should only fire rule number 1 cause only the element c1001 is
null)

Scenario #3
http://drools.46999.n3.nabble.com/file/n3160376/debug3.jpg

with this values when I call fire all rules I dont get any message
(Incorrect - it should activate rule number 2)

This is my model:

http://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar
rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar



Can anybody help me please?, I dont know what am I doing
wrong, thank you
very much :) 



--
View this message in context:

http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160376.html
Sent from the Drools: User forum mailing list archive at
Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli

  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com 

___
rules-users mailing list
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users




--
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools firing wrong rules

2011-07-11 Thread pamerida
Hi.. sorry I didnt include all the information... 
heres the class Im using

http://drools.46999.n3.nabble.com/file/n3160827/ruleInvoker.java
ruleInvoker.java 

I use the method "invocarReglas"...

I dont modify any fact, the values I show there are set before I insert the
fact into the session...

Im using drools 5.2

thanks for your help



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160827.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools firing wrong rules

2011-07-11 Thread Wolfgang Laun
It's indeed a bug - a regression from 5.1.1.

Depending on the fact classes coming from Java or their being declared in
DRL, different error scenarios can be reproduced - see JBRULES-3129 and
JBRULES-3130, the latter being the issue reported by pamerida.

@pamerida: With 5.2.0, the only workaround that appears to cover all
contigencies is to give the mvel-ish expression a wide berth and use

eval( ((Three)list.get(0)).getA() == null )


On 12 July 2011 01:37, pamerida  wrote:

> Hi.. sorry I didnt include all the information...
> heres the class Im using
>
> http://drools.46999.n3.nabble.com/file/n3160827/ruleInvoker.java
> ruleInvoker.java
>
> I use the method "invocarReglas"...
>
> I dont modify any fact, the values I show there are set before I insert the
> fact into the session...
>
> Im using drools 5.2
>
> thanks for your help
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160827.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools firing wrong rules

2011-07-12 Thread Edson Tirelli
   Ok, we will take a look at that. Thanks for reporting and verifying this.

   Edson

2011/7/12 Wolfgang Laun 

> It's indeed a bug - a regression from 5.1.1.
>
> Depending on the fact classes coming from Java or their being declared in
> DRL, different error scenarios can be reproduced - see JBRULES-3129 and
> JBRULES-3130, the latter being the issue reported by pamerida.
>
> @pamerida: With 5.2.0, the only workaround that appears to cover all
> contigencies is to give the mvel-ish expression a wide berth and use
>
> eval( ((Three)list.get(0)).getA() == null )
>
>
>
> On 12 July 2011 01:37, pamerida  wrote:
>
>> Hi.. sorry I didnt include all the information...
>> heres the class Im using
>>
>> http://drools.46999.n3.nabble.com/file/n3160827/ruleInvoker.java
>> ruleInvoker.java
>>
>> I use the method "invocarReglas"...
>>
>> I dont modify any fact, the values I show there are set before I insert
>> the
>> fact into the session...
>>
>> Im using drools 5.2
>>
>> thanks for your help
>>
>>
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160827.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>


-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools firing wrong rules

2011-07-12 Thread pamerida
Thanks Wolfgang Laun-2...

Ive been working on the code and this

Cuscar(bgm.size > 0 , $v: bgm[0] , $v.c1001== null ); 

seems to work too, I just added the variable declaration, have no idea
why... 

Thanks everyone for your help... 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3162841.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users