Re: [rules-users] Checking in one rule the "result" of another rule

2010-01-31 Thread orchid
Wolfgang and Edson, thank you very much for the detailed replies. I understand that logically my wish might be incorrect, but this is a requirement we have. I will try to explain my situation in detailed: 1. The facts are of class Word. The rules check characteristics of words, such as letters d

[rules-users] Checking in one rule the "result" of another rule

2010-01-31 Thread orchid
Hi All, I have "rule1" and "rule2", very simple rules. I would like in "rule3" to check one of the following: "rule1" AND "rule2" (i.e. if both rule1 and rule2 were fired) "rule1" OR "rule2" (rule1 or rule2 was fired) How can I achieve this? Does the "extends" keyword might help here? I ach

Re: [rules-users] Define global varibales to several drl files

2010-01-26 Thread orchid
Can someone help me please with this question? -- View this message in context: http://n3.nabble.com/Define-global-varibales-to-several-drl-files-tp138974p139254.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users maili

[rules-users] Define global varibales to several drl files

2010-01-26 Thread orchid
Hi, I would like to ask if it possible to define a global variables which can be accessed from rules which are defined in several drl files? My idea behind this is to hold some structure (array for example) which will hold the results of all rules. The rules are defined in several files. All RH

[rules-users] How to compare dates from a rule

2010-01-19 Thread orchid
Hi, I have a class Doc which contains a field date of type java.util.Date. I would like in my rule to compare dates, something like: $d: Doc(date > "10/10/2009" && date < "19/01/2010"). How can I do that? Thanks !!! -- View this message in context: http://n3.nabble.com/How-to-compare-dates

[rules-users] Infinite loop when re-activating rules

2010-01-17 Thread orchid
Hi All, I have a question about avoiding infinite loop, not using 'no-loop' or 'lock-active' since I want to re-activate rules. Suppose I have one complex class C and a chain of rules in which Rule2 checks the result of Rule1, Rule 3 checks the result of rule 2, etc... In the last rule ("Rule5")

Re: [rules-users] Infinite loop when nesting rules

2010-01-11 Thread orchid
Thank you both for the quick reply. I used lock-on-active in Rule1 and Rule2 and it worked :-) -- View this message in context: http://n3.nabble.com/Infinite-loop-when-nesting-rules-tp116764p117645.html Sent from the Drools - User mailing list archive at Nabble.com. _

Re: [rules-users] Firing only changed object rules in stateful sessions

2010-01-11 Thread orchid
I have a question to salaboy: If you have several rules which check and modify an object, will you need to add several properties to indicate which rule chagned that object. For example: rule "Rule1" no-loop true when $c:Chesse(type="Chedar") then modify ($c){addRule("Rule1")}

[rules-users] Infinite loop when nesting rules

2010-01-11 Thread orchid
Hi, I have another question regarding rules nesting. I have the following Rule1 and Rule2 which check some property of Cheese type (I dont want to merge them into one rule). The "then" part of these rules updates the list field of class Cheese which holds the rules that were fired for a specific

Re: [rules-users] Using a global list in a rule

2010-01-11 Thread orchid
Thanks :-) -- View this message in context: http://n3.nabble.com/Using-a-global-list-in-a-rule-tp115746p116747.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.j

Re: [rules-users] Using a global list in a rule

2010-01-11 Thread orchid
Thank you. It worked. Should I always use 'eval' to get a method result? salaboy wrote: > > did you try with: > eval(list.contains("rule1")) ? > > > On Sun, Jan 10, 2010 at 6:37 AM, orchid wrote: > >> >> Hi All, >> >> I ha

[rules-users] Using a global list in a rule

2010-01-10 Thread orchid
Hi All, I have a question regarding using a global list. I have the following rule: global java.util.List list List; Rule "rule1" when A then list.add("rule1"); When I'm trying to check the list content in LHS of another rule I get a compilation error: "mismatch input ...": Rule "rule

[rules-users] Show the rational of rule that was fired

2010-01-09 Thread orchid
Hi All, I wonder whether Drools (I'm using version 5.x) has functionality to display the rational of a rule that was fired. I mean: if my rule is as following: Rule "rule1" when A || B then C and the rule was fired because B part was true, can I point out that the rule was fired becuase

Re: [rules-users] Call class method from LHS of a rule

2010-01-04 Thread orchid
Esteban and Wolfgang, thank you very much !!! -- View this message in context: http://n3.nabble.com/Call-class-method-from-LHS-of-a-rule-tp108383p108465.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list r

[rules-users] Call class method from LHS of a rule

2010-01-04 Thread orchid
Hi All, I'm trying to call a class method from the LHS of a rule in the following way: public class Cheese{ private string type; //setters and getters public boolean existsInShop(String shop){ ... return true; } } I would like to call the method "existsInShop" from a rule: Rule

Re: [rules-users] Nesting rules in Drools 5.x

2010-01-03 Thread orchid
Thanks !!! Greg Barton wrote: > > It means it's a bug that's fixed in the drools codebase (i.e. trunk) but > not yet released. The easiest way to test this is to use the most > recently built artifacts from hudson: > > https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/tr

Re: [rules-users] How to check an array field from LHS of a rule

2010-01-02 Thread orchid
Thanks!!! I tried your code and it worked. -- View this message in context: http://n3.nabble.com/How-to-check-an-array-field-from-LHS-of-a-rule-tp104523p106929.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailin

Re: [rules-users] Nesting rules in Drools 5.x

2010-01-02 Thread orchid
Sorry, I didn't understand your answer. Greg Barton wrote: > > I think this is fixed in trunk. > > GreG > -- View this message in context: http://n3.nabble.com/Nesting-rules-in-Drools-5-x-tp106902p106928.html Sent from the Drools - User mailing list archive at Nabble.com. _

[rules-users] Nesting rules in Drools 5.x

2010-01-02 Thread orchid
Hi All, I'm trying to nest the LHS of rules in the following way: rule "Rule_stilton" when $c : Cheese (type == "stilton") then $c.addRuleToList( "Rule_stilton" ); System.out.println("Rule_stilton was fired"); end rule "Rule_price" extends "Rule_stilton" when Che

[rules-users] How to check an array field from LHS of a rule

2009-12-31 Thread orchid
Hi All, I'm using Drools 5.x. I have the following class: public class Machine{ ... private List rules = new ArrayList(); ... } The 'rules' list holds strings. I would like from my rule to check whether that list contains the string "rule2". I've tried doing this in the following ways,

[rules-users] Adding/removing DRL file to an existing package

2009-12-22 Thread orchid
Hi, Is it possible to add/remove a drl file to an existing package? Thanks, Orchid -- View this message in context: http://n3.nabble.com/Adding-removing-DRL-file-to-an-existing-package-tp97244p97244.html Sent from the Drools - User mailing list archive at Nabble.com

Re: [rules-users] When changing rules what should be passed to Drools engine?

2009-12-22 Thread orchid
Best, > > On Tue, Dec 22, 2009 at 9:51 AM, orchid wrote: > >> >> >> >> Esteban Aliverti wrote: >> > >> > Hi, >> > It will be better if you can pass just the modified rule, because rules >> > need >> > to be compi

Re: [rules-users] When changing rules what should be passed to Drools engine?

2009-12-22 Thread orchid
Esteban Aliverti wrote: > > Hi, > It will be better if you can pass just the modified rule, because rules > need > to be compiled before added to the kbase and that is an expensive task. > > Best > Thanks Esteban! If my .drl file contains several rules and I changed only one of them, I must

[rules-users] When changing rules what should be passed to Drools engine?

2009-12-22 Thread orchid
Hi All, I'm newbie to Drools and would like to ask some questions: 1. When changing a rule, should I pass to the engine only what was change or the whole rule set? 2. What happens from the point the rule was written till it arrives the engine itself? Thanks in advance B-), Orchid. --