Re: [rules-users] Metadata assigned to rules?
rule whatever @meta( data ) when then end -W 2011/3/17 Peter C. Marks peter.c.ma...@gmail.com Hello, In section 4.7.2 of the Drools Expert User Guide, it states: Metadata may be assigned to several different constructions in Drools: fact types, fact attributes and rules. I could not figure out how to attach metadata to a rule. Is this feature available? Thanks, Peter ___ 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 Introduction Documentation --
Is there any reason why you don't start with the binary distributions? Building from the source requires some experience. The message indicates that some tests failed; the reason(s) can be found in files at the indicated location. You could try the build with skipping the tests, add -DskipTests to the mvn call. -W 2011/3/18 Imaad Ghouri imaad.gho...@gmail.com Hi All, I am a newbie and have just started with drools with documentation: http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-introduction/html_single/index.html 1). I am at section 3.4 and got the attached exception while I run the maven command: mvn -Declipse -Ddocumentation clean install -DlocalEclipseDrop=/folder/jboss-drools/local-Eclipse-drop-mirror 2). I am new in the community so i appreciate if some one guide me how to start other than drools documentation so I can start in a right fashion. -- Regards, Imaad Ghouri ___ 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
[rules-users] Drools mvel strict type
Hi all, Do someone knows how to disable strict type from the rule itself? Or the way to cast segments in (String []) in the following rule: dialect mvel when $m : Parent(); $mess : Message() from $m.message; $seg : String[]() from $m.*segments*; my error at deployment of drools-server is : *unqualified type in strict mode for: segments]* Thanks in advance Seb ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools mvel strict type
The Java type of $m.segments would be - what? -W 2011/3/18 Sébastien Raickman sebastien.raick...@gmail.com Hi all, Do someone knows how to disable strict type from the rule itself? Or the way to cast segments in (String []) in the following rule: dialect mvel when $m : Parent(); $mess : Message() from $m.message; $seg : String[]() from $m.*segments*; my error at deployment of drools-server is : *unqualified type in strict mode for: segments]* Thanks in advance Seb ___ 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 mvel strict type
Is segments a list of arrays of String? If not something like this is probably what you're after:- when $p : Parent( $mess : message ); $seg : String() from $p.*segments* The rule will activate for each segment in segments. 2011/3/18 Sébastien Raickman sebastien.raick...@gmail.com Hi all, Do someone knows how to disable strict type from the rule itself? Or the way to cast segments in (String []) in the following rule: dialect mvel when $m : Parent(); $mess : Message() from $m.message; $seg : String[]() from $m.*segments*; my error at deployment of drools-server is : *unqualified type in strict mode for: segments]* Thanks in advance Seb ___ 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
[rules-users] Question regarding drools example
Hi, I'm new to drools and i'm trying to learn through the drools examples. Inside the file org.drools.examples.process.order.logging.drl I see this : workItem: WorkItemImpl( state == WorkItemImpl.PENDING ) from workItemNodeInstance.getWorkItem() The PENDING constant seems to be missing in the org.drools.process.instance.impl.WorkItemImpl class Am I missing something ? Thanks Yannick ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Question regarding drools example
Yannick, those constants are defined in org.drools.runtime.process.WorkItem which is one of the interfaces implemented by org.drools.process.instance.impl.WorkItemImpl Regards 2011/3/18 DECOUX Yannick yannick.dec...@ucm.be: Hi, I’m new to drools and i’m trying to learn through the drools examples. Inside the file org.drools.examples.process.order.logging.drl I see this : workItem: WorkItemImpl( state == WorkItemImpl.PENDING ) from workItemNodeInstance.getWorkItem() The PENDING constant seems to be missing in the org.drools.process.instance.impl.WorkItemImpl class Am I missing something ? Thanks Yannick ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- diego ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Starting engine using fireUntilHalt and inserting no facts results in 50% CPU usage
Hello: I see this is marked as fixed in https://issues.jboss.org/browse/JBRULES-2756 https://issues.jboss.org/browse/JBRULES-2756 , but I am still experiencing high CPU usage with version 5.2.0.M1. Anyone still seeing this? This is my first attempt at using Fusion, so I could be doing something wrong. I am not sure about the approach of calling fireAllRules on a timer v.s. the continuous fireUntilHalt. I think I need to keep the session in fire mode all the time to properly catch all events and allow for time sensitive rules to fire, but I don't have the luxury of keeping one of the CPUs at near 100% all the time. Since I am new to CEP, I am not sure what happens to time-window rules in the case of periodically calling fireAllRules. What happens to events inserted into entry-points when the session is not in firing mode? TIA, Alex -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Starting-engine-using-fireUntilHalt-and-inserting-no-facts-results-in-50-CPU-usage-tp1760370p2697950.html Sent from the Drools - User 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 mvel strict type
$m.segments is java.util.ListString I want to evaluate one of the String (the first of the List) How should I do it? Thanks 2011/3/18 Wolfgang Laun wolfgang.l...@gmail.com The Java type of $m.segments would be - what? -W 2011/3/18 Sébastien Raickman sebastien.raick...@gmail.com Hi all, Do someone knows how to disable strict type from the rule itself? Or the way to cast segments in (String []) in the following rule: dialect mvel when $m : Parent(); $mess : Message() from $m.message; $seg : String[]() from $m.*segments*; my error at deployment of drools-server is : *unqualified type in strict mode for: segments]* Thanks in advance Seb ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Agenda Groups and Salience
Hello, Are there any conflicts in 5.1 between using salience and agenda groups? I have three sets of rules 1) base software, 2) Trading Partner Specific, 3) Customer Specific. These three sets are split into different Guvnor packages and all of #1 have an agenda group of base, all of #2 have an agenda group of tradingpartner and all of #3 have no agenda group assigned. We load all the rules to the knowledge session, letting it know to fire them in that order. In my #1 set I have a few hundred rules. About 10 of those rules it matters what individual order they fire in so I was setting up salience for them as well. Rule #1 has a salience of 21000 and it's job is to see if this is the first line item of a claim and if so to instantiate a new object, hasCOB. Rule #2 has a salience of 20900 and checks to see if the incoming claim is medicare and if so, sets a Boolean, hasMedicare, to true and then does some output so I know if it set it Rule #3 has a salience of 20900 and checks to see if the incoming claim is other insurance and if so, sets a Boolean, hasOther, to true and then does some output so i know if it set it Rule #4 has a salience of 20800 and looks to see if there is a hasCOB object with hasMedicare = to true and then does output so I know if it worked Rule #5 has a salience of 20800 and looks to see if there is a hasCOB object with hasOther = to true and then does output so I know if it worked So I run a sample file through that hasCOB and should set hasOther to true. Rule #1 fires and creates hasCOB Rule #3 fires and sets hasOther to true and gives me output Rule #5 doesn't fire??? Whether or not salience is the best method to accomplish this, shouldn't this work? DO you see a better way to accomplish this? Rules 4 and 5 are dummy rules here for testing, but what comes next is calculations based upon the existence of hasOther and/or hasMedicare. I'm at a loss here and any thoughts/help would be welcomed... Thank you! Dean ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Starting engine using fireUntilHalt and inserting no facts results in 50% CPU usage
My bad, the EAR packaging was wrong causing version 5.1.1 to be the one being deployed (due to other modules included in the EAR). 5.2.0.M1 does indeed fix the high CPU usage. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Starting-engine-using-fireUntilHalt-and-inserting-no-facts-results-in-50-CPU-usage-tp1760370p2698129.html Sent from the Drools - User 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 mvel strict type
Why would you only want to process the first item in the list? That aside, If you really only want to evaluate the first String in the list you might be better off using two rules, something like this: rule 1 when $p : Parent( $mess : message ); $s : ListString() from $p.segments; then if($s.size() 0) { String segment = $s.get(0); insertLogical(new ParentSegment($p, $mess, segment) ); end rule 2 when ParentSegment( $p : parent, $mess : message, $segment : segment ) then end 2011/3/18 Sébastien Raickman sebastien.raick...@gmail.com $m.segments is java.util.ListString I want to evaluate one of the String (the first of the List) How should I do it? Thanks 2011/3/18 Wolfgang Laun wolfgang.l...@gmail.com The Java type of $m.segments would be - what? -W 2011/3/18 Sébastien Raickman sebastien.raick...@gmail.com Hi all, Do someone knows how to disable strict type from the rule itself? Or the way to cast segments in (String []) in the following rule: dialect mvel when $m : Parent(); $mess : Message() from $m.message; $seg : String[]() from $m.*segments*; my error at deployment of drools-server is : *unqualified type in strict mode for: segments]* Thanks in advance Seb ___ 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 ___ 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] Agenda Groups and Salience
Do you inform the engine that values have changed in your RHS:- then modify( incomingClaim ) { setMedicare(true); } ... end On 18 March 2011 14:16, Dean Whisnant d...@basys.com wrote: Hello, Are there any conflicts in 5.1 between using salience and agenda groups? I have three sets of rules 1) base software, 2) Trading Partner Specific, 3) Customer Specific. These three sets are split into different Guvnor packages and all of #1 have an agenda group of base, all of #2 have an agenda group of tradingpartner and all of #3 have no agenda group assigned. We load all the rules to the knowledge session, letting it know to fire them in that order. In my #1 set I have a few hundred rules. About 10 of those rules it matters what individual order they fire in so I was setting up salience for them as well. Rule #1 has a salience of 21000 and it's job is to see if this is the first line item of a claim and if so to instantiate a new object, hasCOB. Rule #2 has a salience of 20900 and checks to see if the incoming claim is medicare and if so, sets a Boolean, hasMedicare, to true and then does some output so I know if it set it Rule #3 has a salience of 20900 and checks to see if the incoming claim is other insurance and if so, sets a Boolean, hasOther, to true and then does some output so i know if it set it Rule #4 has a salience of 20800 and looks to see if there is a hasCOB object with hasMedicare = to true and then does output so I know if it worked Rule #5 has a salience of 20800 and looks to see if there is a hasCOB object with hasOther = to true and then does output so I know if it worked So I run a sample file through that hasCOB and should set hasOther to true. Rule #1 fires and creates hasCOB Rule #3 fires and sets hasOther to true and gives me output Rule #5 doesn't fire??? Whether or not salience is the best method to accomplish this, shouldn't this work? DO you see a better way to accomplish this? Rules 4 and 5 are dummy rules here for testing, but what comes next is calculations based upon the existence of hasOther and/or hasMedicare. I'm at a loss here and any thoughts/help would be welcomed... Thank you! Dean ___ 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
[rules-users] how to ensure that one rule only is executed once?
Hi I just try to uses jboss rules in our projects. I met a question. for example package sample rule rule 1 when $o:Order (amount100 and amount200); then $o.setPrice($o.getPrice()-10); end rule rule 2 when $o:Order (amount200); then $o.setPrice($o.getPrice()-20); end if the fact , order's amount is 210. then the rule2 will be executed, then the rule1 will be fired . I want to stop the session once some rule is executed or how to control the rule flow. thanks in advance -Yong ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Starting engine using fireUntilHalt and inserting no facts results in 50% CPU usage
Confirmed using the standalone test project from a previous thread using 5.2.0.M1. (attached) --- On Fri, 3/18/11, lexsoto lexs...@gmail.com wrote: From: lexsoto lexs...@gmail.com Subject: Re: [rules-users] Starting engine using fireUntilHalt and inserting no facts results in 50% CPU usage To: rules-users@lists.jboss.org Date: Friday, March 18, 2011, 9:37 AM My bad, the EAR packaging was wrong causing version 5.1.1 to be the one being deployed (due to other modules included in the EAR). 5.2.0.M1 does indeed fix the high CPU usage. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Starting-engine-using-fireUntilHalt-and-inserting-no-facts-results-in-50-CPU-usage-tp1760370p2698129.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users DroolsBoxes.tar.gz Description: GNU Zip compressed data ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to ensure that one rule only is executed once?
Hi, From what I know, it's generally better to make the rules idempotent: In your case introduce a discountedPrice field, leaving the original price alone. If you insist on making it run only once instead, you can introduce a field or fact class to mark an order discounted, then all discounting rules know to ignore it. (This gets really complicated if the order amount ever changes and you do need to run the discounting rules again.) Gabor 2011/3/18 yong zhao clun...@yahoo.com.cn: Hi I just try to uses jboss rules in our projects. I met a question. for example package sample rule rule 1 when $o:Order (amount100 and amount200); then $o.setPrice($o.getPrice()-10); end rule rule 2 when $o:Order (amount200); then $o.setPrice($o.getPrice()-20); end if the fact , order's amount is 210. then the rule2 will be executed, then the rule1 will be fired . I want to stop the session once some rule is executed or how to control the rule flow. thanks in advance -Yong ___ 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] how to ensure that one rule only is executed once?
You'd need to make sure you inform the engine that Order's price has changed:- when ... then modify( $o ) { setPrice( $o.getPrice() - 20); } You could also consider using agenda-groups or lock-on-active to provide your behaviour. *agenda-groups * rule rule 1 //implied default agenda-group of MAIN when $o : Order (amount100 200); then modify( $o ) { setPrice( $o.getPrice() - 10); } drools.setFocus(next step in calculation); end rule rule 2 //implied default agenda-group of MAIN when $o:Order (amount200); then modify( $o ) { setPrice($o.getPrice() - 20); } drools.setFocus(next step in calculation); end rule rule 3 agenda-group next step in calculation when $o : Order() then end *lock-on-active* rule rule 1 //implied default agenda-group of MAIN lock-on-active true when $o : Order (amount100 200); then modify( $o ) { setPrice( $o.getPrice() - 10); } end rule rule 2 //implied default agenda-group of MAIN lock-on-active true when $o:Order (amount200); then modify( $o ) { setPrice($o.getPrice() - 20); } end rule rule 3 agenda-group next step in calculation when $o : Order() then end On 18 March 2011 16:08, Gabor Szokoli szoc...@gmail.com wrote: Hi, From what I know, it's generally better to make the rules idempotent: In your case introduce a discountedPrice field, leaving the original price alone. If you insist on making it run only once instead, you can introduce a field or fact class to mark an order discounted, then all discounting rules know to ignore it. (This gets really complicated if the order amount ever changes and you do need to run the discounting rules again.) Gabor 2011/3/18 yong zhao clun...@yahoo.com.cn: Hi I just try to uses jboss rules in our projects. I met a question. for example package sample rule rule 1 when $o:Order (amount100 and amount200); then $o.setPrice($o.getPrice()-10); end rule rule 2 when $o:Order (amount200); then $o.setPrice($o.getPrice()-20); end if the fact , order's amount is 210. then the rule2 will be executed, then the rule1 will be fired . I want to stop the session once some rule is executed or how to control the rule flow. thanks in advance -Yong ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Introduction Documentation --
Hi, Thanks for the reply. There is no reason why i started building from the source. I just started with the drools introduction. Section 3.1 http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-introduction/html_single/index.html#d0e1934 I would certainly go with the easiest way to get started with drools. Kindly tell me from where I can download the binary distribution. I am not able to find it. This is what I have done so far: 1). Installed Eclipse GEF. 2). Installed drools plugin 3). Installed svn, maven and ant. Added bin's in PATH variable (java, ant maven). 4). Check out drools source code through svn http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/ Also, I will appreciate if some one tell me the road map for newbies. Or staring with given drools documentation is just fine ? Thanks in advance, isg 2011/3/17 Wolfgang Laun wolfgang.l...@gmail.com Is there any reason why you don't start with the binary distributions? Building from the source requires some experience. The message indicates that some tests failed; the reason(s) can be found in files at the indicated location. You could try the build with skipping the tests, add -DskipTests to the mvn call. -W 2011/3/18 Imaad Ghouri imaad.gho...@gmail.com Hi All, I am a newbie and have just started with drools with documentation: http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-introduction/html_single/index.html 1). I am at section 3.4 and got the attached exception while I run the maven command: mvn -Declipse -Ddocumentation clean install -DlocalEclipseDrop=/folder/jboss-drools/local-Eclipse-drop-mirror 2). I am new in the community so i appreciate if some one guide me how to start other than drools documentation so I can start in a right fashion. -- Regards, Imaad Ghouri ___ 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 -- Regards, Imaad Ghouri ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Introduction Documentation --
Hi, Binaries are available from http://www.jboss.org/drools/downloads (Drools Binaries). You won't need SVN anymore (we migrated to GIT over Christmas: https://github.com/droolsjbpm, although the binaries will probably be enough for you for now). Roadmap would be read the Drools Expert documents and look at the examples really :) With kind regards, Mike 2011/3/18 Imaad Ghouri imaad.gho...@gmail.com Hi, Thanks for the reply. There is no reason why i started building from the source. I just started with the drools introduction. Section 3.1 http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-introduction/html_single/index.html#d0e1934 I would certainly go with the easiest way to get started with drools. Kindly tell me from where I can download the binary distribution. I am not able to find it. This is what I have done so far: 1). Installed Eclipse GEF. 2). Installed drools plugin 3). Installed svn, maven and ant. Added bin's in PATH variable (java, ant maven). 4). Check out drools source code through svn http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/ Also, I will appreciate if some one tell me the road map for newbies. Or staring with given drools documentation is just fine ? Thanks in advance, isg 2011/3/17 Wolfgang Laun wolfgang.l...@gmail.com Is there any reason why you don't start with the binary distributions? Building from the source requires some experience. The message indicates that some tests failed; the reason(s) can be found in files at the indicated location. You could try the build with skipping the tests, add -DskipTests to the mvn call. -W 2011/3/18 Imaad Ghouri imaad.gho...@gmail.com Hi All, I am a newbie and have just started with drools with documentation: http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-introduction/html_single/index.html 1). I am at section 3.4 and got the attached exception while I run the maven command: mvn -Declipse -Ddocumentation clean install -DlocalEclipseDrop=/folder/jboss-drools/local-Eclipse-drop-mirror 2). I am new in the community so i appreciate if some one guide me how to start other than drools documentation so I can start in a right fashion. -- Regards, Imaad Ghouri ___ 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 -- Regards, Imaad Ghouri ___ 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
[rules-users] drools.rulebase.conf or rulebase.conf?
From looking at the source code, it appears that the configuration file that is scanned for by KnowledgeBaseConfiguration is named rulebase.conf, not drools.rulebase.conf as mentioned in countless articles. Furthermore, a find/grep over the source code does not turn up any drools.rulebase.conf string. I assume, therefore, that this is a documentation bug, and that the file that is actually sought is named rulebase.conf, and that's where I should put the properties that are named by the KnowledgeBaseConfiguration Javadoc? Thanks, Laird -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-rulebase-conf-or-rulebase-conf-tp2699474p2699474.html Sent from the Drools - User 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] Drools java program on Apple Ipad?
I was just asked to investigate porting a drools based program to an Ipad. Any ideas? Regards, Jared -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-java-program-on-Apple-Ipad-tp2699958p2699958.html Sent from the Drools - User 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 ensure that one rule only is executed once?
Hi Yong, Have you tried with retract the fact after your operation done. Like as follows package sample rule rule 1 when $o:Order (amount100 and amount200); then $o.setPrice($o.getPrice()-10); retract($o); end rule rule 2 when $o:Order (amount200); then $o.setPrice($o.getPrice()-20); retract($o); end Thanks, Subhas 2011/3/18 yong zhao clun...@yahoo.com.cn Hi I just try to uses jboss rules in our projects. I met a question. for example package sample rule rule 1 when $o:Order (amount100 and amount200); then $o.setPrice($o.getPrice()-10); end rule rule 2 when $o:Order (amount200); then $o.setPrice($o.getPrice()-20); end if the fact , order's amount is 210. then the rule2 will be executed, then the rule1 will be fired . I want to stop the session once some rule is executed or how to control the rule flow. thanks in advance -Yong ___ 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 java program on Apple Ipad?
Whilst no expert, Google suggests the iPad doesn't support Java which would make running Drools very (impossibly) difficult: http://www.theipadguide.com/faq/does-ipad-support-java Obviously we welcome a port ;) On 18 March 2011 22:10, Jared Davis sun...@davisprogramming.com wrote: I was just asked to investigate porting a drools based program to an Ipad. Any ideas? Regards, Jared -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-java-program-on-Apple-Ipad-tp2699958p2699958.html Sent from the Drools - User 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
[rules-users] 回复: how to ensure that one rule only is executed once?
thanks , Both are possible ways for the issue though they are a little complicated. 发件人: Michael Anstis michael.ans...@gmail.com 收件人: Rules Users List rules-users@lists.jboss.org 发送日期: 2011/3/19 (周六) 12:25:48 上午 主 题: Re: [rules-users] how to ensure that one rule only is executed once? You'd need to make sure you inform the engine that Order's price has changed:- when ... then modify( $o ) { setPrice( $o.getPrice() - 20); } You could also consider using agenda-groups or lock-on-active to provide your behaviour. agenda-groups rule rule 1 //implied default agenda-group of MAIN when $o : Order (amount100 200); then modify( $o ) { setPrice( $o.getPrice() - 10); } drools.setFocus(next step in calculation); end rule rule 2 //implied default agenda-group of MAIN when $o:Order (amount200); then modify( $o ) { setPrice($o.getPrice() - 20); } drools.setFocus(next step in calculation); end rule rule 3 agenda-group next step in calculation when $o : Order() then end lock-on-active rule rule 1 //implied default agenda-group of MAIN lock-on-active true when $o : Order (amount100 200); then modify( $o ) { setPrice( $o.getPrice() - 10); } end rule rule 2 //implied default agenda-group of MAIN lock-on-active true when $o:Order (amount200); then modify( $o ) { setPrice($o.getPrice() - 20); } end rule rule 3 agenda-group next step in calculation when $o : Order() then end On 18 March 2011 16:08, Gabor Szokoli szoc...@gmail.com wrote: Hi, From what I know, it's generally better to make the rules idempotent: In your case introduce a discountedPrice field, leaving the original price alone. If you insist on making it run only once instead, you can introduce a field or fact class to mark an order discounted, then all discounting rules know to ignore it. (This gets really complicated if the order amount ever changes and you do need to run the discounting rules again.) Gabor 2011/3/18 yong zhao clun...@yahoo.com.cn: Hi I just try to uses jboss rules in our projects. I met a question. for example package sample rule rule 1 when $o:Order (amount100 and amount200); then $o.setPrice($o.getPrice()-10); end rule rule 2 when $o:Order (amount200); then $o.setPrice($o.getPrice()-20); end if the fact , order's amount is 210. then the rule2 will be executed, then the rule1 will be fired . I want to stop the session once some rule is executed or how to control the rule flow. thanks in advance -Yong ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] what implicit instances or function are supported in drl
Hi, Drools document mentioned some implicit operation like insert, modify, update. And drools is also another implicit object in drl file. Are there any other, who could give a full list? thanks. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools java program on Apple Ipad?
To have a minimal Java support you have to jailbreak your iPhone/iPad and install jamVM using the console. The last time I tried the compiler wasn't able to compile the rules, but maybe you can create a .pkg file and load the rules from it. Anyway, I don't think it's going to work. 2011/3/18 Michael Anstis michael.ans...@gmail.com Whilst no expert, Google suggests the iPad doesn't support Java which would make running Drools very (impossibly) difficult: http://www.theipadguide.com/faq/does-ipad-support-java Obviously we welcome a port ;) On 18 March 2011 22:10, Jared Davis sun...@davisprogramming.com wrote: I was just asked to investigate porting a drools based program to an Ipad. Any ideas? Regards, Jared -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-java-program-on-Apple-Ipad-tp2699958p2699958.html Sent from the Drools - User 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users