[rules-users] not operation available in drools

2012-06-14 Thread learner
I have a scenario like below 

Rule a 

When 

! ( 

(aaa == “bbb”)  

(bbb == “aaa”) 

) 

Then 

// do smth 

End 

I’m looking for an operator to reverse the evaluation result of the
expression in the brackets. Is this possible

--
View this message in context: 
http://drools.46999.n3.nabble.com/not-operation-available-in-drools-tp4017936.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] Exit from drl file when the first rule is satisfied

2012-06-13 Thread learner
Hi,

I have a drl file that has 3 rules. I want to exit from the drl file if the
1st rule is satisfied. Is this possible.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Exit-from-drl-file-when-the-first-rule-is-satisfied-tp4017899.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] Else condition in drl file

2012-06-13 Thread learner
Hi,

I have a scenario like

if(value == 200){
  // then do something
}else if(value == 100){
// then do something
}else{
value = 0
}

I created drl with 3 rules
Rule 1 : value  equal 200
Rule 2 : value  equal 100
Rule 3 : value not equal to 100 or 200(ie by value!=200  value!=100 ).

Is there a way by which I can simplify the condition in rule 3.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Else-condition-in-drl-file-tp4017903.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] Exit from drl file when the first rule is satisfied

2012-06-13 Thread learner
Is there any exit statement in drl file to achieve the same.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Exit-from-drl-file-when-the-first-rule-is-satisfied-tp4017899p4017904.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] Is there a logical not available

2012-06-13 Thread learner
I have a scenario like below

Rule a

When

! (

MyObject(aaa == “bbb”) 

MyObject2(bbb == “aaa”)

)

Then

// do smth

End

I’m looking for an operator to reverse the evaluation result of the
expression in the brackets. Is this possible

--
View this message in context: 
http://drools.46999.n3.nabble.com/Is-there-a-logical-not-available-tp4017914.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] how to use only updated value in drools

2012-05-29 Thread learner
I am having a drl file with 2 rules

The 1st rule updates a attribute, say updates attribute b to 10 based on
some condition.

The 2nd rule has a check for values with b not equal to 10. It logs error
for those values not equals to 10.

The b value gets updated to 10 in rule 1. However in the second rule it does
not use updated value and logs error.

Is there a way to use the updated b value in the 2nd rule. I tried using
modify but still the error gets logged.

--
View this message in context: 
http://drools.46999.n3.nabble.com/how-to-use-only-updated-value-in-drools-tp4017626.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] how to use only updated value in drools

2012-05-29 Thread learner
Thanks for the reply.

Please find a basic structure of my drl file

rule set b value
  salience 10
no-loop
when
e : Person(b ==  );
then
e.setB(10);
end
 
rule b other than 10
  salience 1
 no-loop
 when
  e : Person(b != 10)
 then
   System.out.println(error+e.getB());
end

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-how-to-use-only-updated-value-in-drools-tp4017628p4017633.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] how to use only updated value in drools

2012-05-29 Thread learner
I tried using insert but still the issue persists

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-how-to-use-only-updated-value-in-drools-tp4017628p4017635.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] how to use only updated value in drools

2012-05-29 Thread learner
When I use update the message appears twice.

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-how-to-use-only-updated-value-in-drools-tp4017628p4017638.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] how to use only updated value in drools

2012-05-29 Thread learner
Datatype of b is String

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-how-to-use-only-updated-value-in-drools-tp4017628p4017639.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] how to use only updated value in drools

2012-05-29 Thread learner
Modifying the condition does not fix the issue

It seems even though the value of b was modified to 10 in the first rule. It
considers b as only blank (initial value) in the When clause of second
rule.However in sysout the value of b appears properly as 10

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-how-to-use-only-updated-value-in-drools-tp4017628p4017641.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] how to use only updated value in drools

2012-05-29 Thread learner
Please find a basic structure of my drl file 

rule set b value 
  salience 10 
no-loop 
when 
e : Person(b ==  ); 
then 
e.setB(10); 
end 
  
rule b other than 10 
  salience 1 
 no-loop 
 when 
  e : Person(b != 10) 
 then 
   System.out.println(error+e.getB()); 
end 

The problem is the sysout gets printed in rule 2 , but it should not as the
value of b is modified to 10 in 1st rule

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-how-to-use-only-updated-value-in-drools-tp4017628p4017647.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] how to use only updated value in drools

2012-05-29 Thread learner
But since the b value is updated to 10 , is there a way to use this updated
value in second rule and not print any sysout. 

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-how-to-use-only-updated-value-in-drools-tp4017628p4017650.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] how to use only updated value in drools

2012-05-29 Thread learner
Use of modify fixed the issue.

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-how-to-use-only-updated-value-in-drools-tp4017628p4017652.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