Re: [rules-users] Question regarding drools example
Hi, Ok, I feel stupid now... :) Thanks -Message d'origine- De : rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] De la part de Diego López León Envoyé : vendredi 18 mars 2011 14:27 À : Rules Users List Objet : 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 ___ 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?
I don't know what your application does or what your requirements are but could you get away with writing a website/service containing all the logic and then allowing the iPad to access that - means that your iPad would always need a connection to use it but would also mean that you get support for android for free as well. Downside is apparently in this new world websites aren't sufficient and you have to have apps to do trivial things the web can do! Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Lucas Amador Sent: 19 March 2011 03:55 To: Rules Users List Subject: 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.commailto: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.commailto: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.orgmailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org 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 postmas...@nds.com 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 rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools java program on Apple Ipad?
Just wondering. But what about Android ? Does anyone already make drools work on it ? Le 19/03/2011 04:54, Lucas Amador a écrit : 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 mailto: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 mailto:sun...@davisprogramming.com wrote: I was just asked to investigate porting a drools based program to an Ipad. Any ideas? Regards, Jared ___ 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?
Drools/jBPM5 can run on android. Kris make a post about it :) http://kverlaen.blogspot.com/2011/03/jbpm5-lightweight-running-on-android.html 2011/3/21 Vincent Legendre vincent.legen...@eurodecision.com Just wondering. But what about Android ? Does anyone already make drools work on it ? Le 19/03/2011 04:54, Lucas Amador a écrit : 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 ___ 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 Introduction Documentation --
Hi, you are probably missing the drools runtime configuration. Check in your setting tab and look for the Drools settings to see if you have it configured. Greetings. 2011/3/20 Imaad Ghouri imaad.gho...@gmail.com Hi, Thanks all for the response. I have started with examples and having an issue while I copied drl-files from drools-examples in eclipse. I see a red cross sign with .drl files. Can someone please explain whats I have missed. Thanks, Imaad 2011/3/18 Michael Anstis michael.ans...@gmail.com 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 -- Regards, Imaad Ghouri ___ 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] Migrate from JBRMS 4.0.7 to Guvnor 5.1
Guys, please any thoughts? -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Migrate-from-JBRMS-4-0-7-to-Guvnor-5-1-tp2692846p2709675.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] Limiting rule evaluation--not firing
Hi, Having the same questions you had, I played a bit with agenda-groups to see if there was any notable performance effect. I added 200 extra rules which did not fire at all and did two series of rule executions. Once with all rules within the same agenda-group and once with the 200 extra rules in a different agenda-group, while setting focus to the firing rules. Allthough I cannot claim statistical significance, I didn't notice big effects. As I consider it, the reason for still evaluating all rules is because you would need an Update() statement everytime focus is switched to an other agenda-group to make sure Objects are matched to those rules. Maybe ruleflow-groups work a bit different - allthough I doubt it - but I haven't played with them yet. Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Limiting-rule-evaluation-not-firing-tp2695533p2709697.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] Limiting rule evaluation--not firing
The algorithm as is does eager evaluation, as for the general case that is still better than doing selective evaluation. If, in your case, the decision of which rules to fire is an arbitrary application decision, and not based on the actual constraints of the rules themselves, then the only way would be by creating a control fact: rule 1 when ControlFact( phase == Phase.ONE ) ... rule 2 when ControlFact( phase == Phase.TWO ) ... This way, if the control fact is the first pattern in each rule it effectively disables all the beta evaluations for rules of phases other than the current one. Just be aware that by blocking the eager evaluation this way, phase switches are heavier than without the control fact, where most constraints were already previously evaluated. Obvious, but worth saying out loud... :) There is also a feature that Leonardo is working on that makes the engine automatically unlink and relink parts of the network, based on the existence and possibility of matching the other required facts in a rule LHS. It might achieve similar results to what you are looking for in some cases, but that is totally based on the constraints in there and not on any arbitrary application decision. Edson 2011/3/21 FrankVhh frank.vanhoensho...@agserv.eu Hi, Having the same questions you had, I played a bit with agenda-groups to see if there was any notable performance effect. I added 200 extra rules which did not fire at all and did two series of rule executions. Once with all rules within the same agenda-group and once with the 200 extra rules in a different agenda-group, while setting focus to the firing rules. Allthough I cannot claim statistical significance, I didn't notice big effects. As I consider it, the reason for still evaluating all rules is because you would need an Update() statement everytime focus is switched to an other agenda-group to make sure Objects are matched to those rules. Maybe ruleflow-groups work a bit different - allthough I doubt it - but I haven't played with them yet. Regards, Frank -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Limiting-rule-evaluation-not-firing-tp2695533p2709697.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 -- 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 5.1.1 : Error reporting issue in PackageBuilder
ok?! Should i file a JIRA? -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-1-1-Error-reporting-issue-in-PackageBuilder-tp2705166p2709887.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] Limiting rule evaluation--not firing
And what about ruleflow-group ? There is no network filtering for that too ? The ruleflow-group behaves like an agenda filter, but still evaluate all nodes ? Could we imagine setting tags to nodes, and stop propagation for node that does not declare the current task tag ? Le 21/03/2011 14:20, Edson Tirelli a écrit : The algorithm as is does eager evaluation, as for the general case that is still better than doing selective evaluation. If, in your case, the decision of which rules to fire is an arbitrary application decision, and not based on the actual constraints of the rules themselves, then the only way would be by creating a control fact: rule 1 when ControlFact( phase == Phase.ONE ) ... rule 2 when ControlFact( phase == Phase.TWO ) ... This way, if the control fact is the first pattern in each rule it effectively disables all the beta evaluations for rules of phases other than the current one. Just be aware that by blocking the eager evaluation this way, phase switches are heavier than without the control fact, where most constraints were already previously evaluated. Obvious, but worth saying out loud... :) There is also a feature that Leonardo is working on that makes the engine automatically unlink and relink parts of the network, based on the existence and possibility of matching the other required facts in a rule LHS. It might achieve similar results to what you are looking for in some cases, but that is totally based on the constraints in there and not on any arbitrary application decision. Edson ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Limiting rule evaluation--not firing
The thing to remember is that fact evaluation occurs at object insert/update time, not at the point you call fireAllRules. Salience, Agenda and rufeflow control on the other hand are runtime conditions which control which rules are actually activated in what order. Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Vincent Legendre Sent: 21 March 2011 13:34 To: Rules Users List Subject: Re: [rules-users] Limiting rule evaluation--not firing And what about ruleflow-group ? There is no network filtering for that too ? The ruleflow-group behaves like an agenda filter, but still evaluate all nodes ? Could we imagine setting tags to nodes, and stop propagation for node that does not declare the current task tag ? Le 21/03/2011 14:20, Edson Tirelli a écrit : The algorithm as is does eager evaluation, as for the general case that is still better than doing selective evaluation. If, in your case, the decision of which rules to fire is an arbitrary application decision, and not based on the actual constraints of the rules themselves, then the only way would be by creating a control fact: rule 1 when ControlFact( phase == Phase.ONE ) ... rule 2 when ControlFact( phase == Phase.TWO ) ... This way, if the control fact is the first pattern in each rule it effectively disables all the beta evaluations for rules of phases other than the current one. Just be aware that by blocking the eager evaluation this way, phase switches are heavier than without the control fact, where most constraints were already previously evaluated. Obvious, but worth saying out loud... :) There is also a feature that Leonardo is working on that makes the engine automatically unlink and relink parts of the network, based on the existence and possibility of matching the other required facts in a rule LHS. It might achieve similar results to what you are looking for in some cases, but that is totally based on the constraints in there and not on any arbitrary application decision. Edson ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com 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 rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Limiting rule evaluation--not firing
ok. So the only way to do that is to add a control fact, and update it at runtime... Do you think that using the control fact method will speed up the execution time for a large ruleset that have different ruleflow-group ? My feeling is yes, especially if first rules does many updates, but I haven't done any tests. Le 21/03/2011 14:37, Swindells, Thomas a écrit : The thing to remember is that fact evaluation occurs at object insert/update time, not at the point you call fireAllRules. Salience, Agenda and rufeflow control on the other hand are runtime conditions which control which rules are actually activated in what order. Thomas *From:*rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] *On Behalf Of *Vincent Legendre *Sent:* 21 March 2011 13:34 *To:* Rules Users List *Subject:* Re: [rules-users] Limiting rule evaluation--not firing And what about ruleflow-group ? There is no network filtering for that too ? The ruleflow-group behaves like an agenda filter, but still evaluate all nodes ? Could we imagine setting tags to nodes, and stop propagation for node that does not declare the current task tag ? Le 21/03/2011 14:20, Edson Tirelli a écrit : The algorithm as is does eager evaluation, as for the general case that is still better than doing selective evaluation. If, in your case, the decision of which rules to fire is an arbitrary application decision, and not based on the actual constraints of the rules themselves, then the only way would be by creating a control fact: rule 1 when ControlFact( phase == Phase.ONE ) ... rule 2 when ControlFact( phase == Phase.TWO ) ... This way, if the control fact is the first pattern in each rule it effectively disables all the beta evaluations for rules of phases other than the current one. Just be aware that by blocking the eager evaluation this way, phase switches are heavier than without the control fact, where most constraints were already previously evaluated. Obvious, but worth saying out loud... :) There is also a feature that Leonardo is working on that makes the engine automatically unlink and relink parts of the network, based on the existence and possibility of matching the other required facts in a rule LHS. It might achieve similar results to what you are looking for in some cases, but that is totally based on the constraints in there and not on any arbitrary application decision. Edson ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.com 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 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] Limiting rule evaluation--not firing
That's probably the best way to go. I think it's a case of experimentation to work out what runs best (and please report your results). Things to consider are what order you have the conditions in the rules (the control fact first is probably most efficient but may be worth comparing with it at the end) and the order you insert facts - do you insert the control fact first or last. Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Vincent Legendre Sent: 21 March 2011 13:47 To: Rules Users List Subject: Re: [rules-users] Limiting rule evaluation--not firing ok. So the only way to do that is to add a control fact, and update it at runtime... Do you think that using the control fact method will speed up the execution time for a large ruleset that have different ruleflow-group ? My feeling is yes, especially if first rules does many updates, but I haven't done any tests. Le 21/03/2011 14:37, Swindells, Thomas a écrit : The thing to remember is that fact evaluation occurs at object insert/update time, not at the point you call fireAllRules. Salience, Agenda and rufeflow control on the other hand are runtime conditions which control which rules are actually activated in what order. Thomas From: rules-users-boun...@lists.jboss.orgmailto:rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Vincent Legendre Sent: 21 March 2011 13:34 To: Rules Users List Subject: Re: [rules-users] Limiting rule evaluation--not firing And what about ruleflow-group ? There is no network filtering for that too ? The ruleflow-group behaves like an agenda filter, but still evaluate all nodes ? Could we imagine setting tags to nodes, and stop propagation for node that does not declare the current task tag ? Le 21/03/2011 14:20, Edson Tirelli a écrit : The algorithm as is does eager evaluation, as for the general case that is still better than doing selective evaluation. If, in your case, the decision of which rules to fire is an arbitrary application decision, and not based on the actual constraints of the rules themselves, then the only way would be by creating a control fact: rule 1 when ControlFact( phase == Phase.ONE ) ... rule 2 when ControlFact( phase == Phase.TWO ) ... This way, if the control fact is the first pattern in each rule it effectively disables all the beta evaluations for rules of phases other than the current one. Just be aware that by blocking the eager evaluation this way, phase switches are heavier than without the control fact, where most constraints were already previously evaluated. Obvious, but worth saying out loud... :) There is also a feature that Leonardo is working on that makes the engine automatically unlink and relink parts of the network, based on the existence and possibility of matching the other required facts in a rule LHS. It might achieve similar results to what you are looking for in some cases, but that is totally based on the constraints in there and not on any arbitrary application decision. Edson ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.commailto:postmas...@nds.com 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 rules-users@lists.jboss.orgmailto: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] Limiting rule evaluation--not firing
Given that facts (after some common initial processing) fall into two or more classes that should be processed with significantly different (although not necessarily disjoint) sets of rules and also given that the fact and/or rule number is prohibitive for processing according to the simple design pattern of throwing it all into one basket:-- Why not create two (or more) different rule bases and spawn a session from each? Initial processing could be done with an additional (simple) engine, with the other sessions being provided via some global, as a service, ready to accept the classified facts. True, there will be some overhead, but it's a clean solution, doesn't mess up the rules with control facts and you get exactly those rules to work on your facts you put into the different K-bases. -W ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Limiting rule evaluation--not firing
Hi all, This is a very interesting discussion, so I re-read the Drools Flow manual. IN section 8.1, it is stated as one of the reasons to use rules in your process: Performance: Rule evaluation is optimized. How do I have to understand this? Does rule evaluation only happens for the rules that are in the current ruleflowgroup? Because the above conversation seems to imply it isn't. Regards, Frank Swindells, Thomas wrote: That's probably the best way to go. I think it's a case of experimentation to work out what runs best (and please report your results). Things to consider are what order you have the conditions in the rules (the control fact first is probably most efficient but may be worth comparing with it at the end) and the order you insert facts - do you insert the control fact first or last. Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Vincent Legendre Sent: 21 March 2011 13:47 To: Rules Users List Subject: Re: [rules-users] Limiting rule evaluation--not firing ok. So the only way to do that is to add a control fact, and update it at runtime... Do you think that using the quot;control factquot; method will speed up the execution time for a large ruleset that have different ruleflow-group ? My feeling is yes, especially if quot;firstquot; rules does many updates, but I haven't done any tests. Le 21/03/2011 14:37, Swindells, Thomas a écrit : The thing to remember is that fact evaluation occurs at object insert/update time, not at the point you call fireAllRules. Salience, Agenda and rufeflow control on the other hand are runtime conditions which control which rules are actually activated in what order. Thomas From: rules-users-boun...@lists.jboss.orglt;mailto:rules-users-boun...@lists.jboss.orggt; [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Vincent Legendre Sent: 21 March 2011 13:34 To: Rules Users List Subject: Re: [rules-users] Limiting rule evaluation--not firing And what about ruleflow-group ? There is no network filtering for that too ? The ruleflow-group behaves like an agenda filter, but still evaluate all nodes ? Could we imagine setting quot;tagsquot; to nodes, and stop propagation for node that does not declare the current task tag ? Le 21/03/2011 14:20, Edson Tirelli a écrit : The algorithm as is does eager evaluation, as for the general case that is still better than doing selective evaluation. If, in your case, the decision of which rules to fire is an arbitrary application decision, and not based on the actual constraints of the rules themselves, then the only way would be by creating a control fact: rule 1 when ControlFact( phase == Phase.ONE ) ... rule 2 when ControlFact( phase == Phase.TWO ) ... This way, if the control fact is the first pattern in each rule it effectively disables all the beta evaluations for rules of phases other than the current one. Just be aware that by blocking the eager evaluation this way, phase switches are heavier than without the control fact, where most constraints were already previously evaluated. Obvious, but worth saying out loud... :) There is also a feature that Leonardo is working on that makes the engine automatically unlink and relink parts of the network, based on the existence and possibility of matching the other required facts in a rule LHS. It might achieve similar results to what you are looking for in some cases, but that is totally based on the constraints in there and not on any arbitrary application decision. Edson ** This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmas...@nds.comlt;mailto:postmas...@nds.comgt; 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 rules-users@lists.jboss.orglt;mailto:rules-users@lists.jboss.orggt; 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 -- View this message in context:
[rules-users] Parsing problems using a DSL
I have run into a number of problems using a domain specific language (DSL) on processing DSLR files. My biggest frustration - and one I am hoping people can provide a work-around or guidance on - is that often the Eclipse plug-in does not allow the DRL pane, showing the DRL file, to be clicked on (and shown.) This sometimes happens when there are no compilation errors: the DLR file is simply not being generated. I have run into issues where an error like parsing problem: contact the support team occurs or a null pointer exception occurs, but no error is shown. My approach has been to make small changes in working DSL files (i.e., describing the translations) at a time, to minimize impact. Can anyone offer better approaches to building the DSL grammar? On a related issue, many documents cite using DSL and regular expressions for code-rewriting and - while I find documentation on antlr 3 masks for doing some regular expressions - is the common re-writing task of using or - as in My object (Car|Bus|Buyer|Salesman) supported in any way other than seperate lines for object Car, object Bus, etc? Thanks! -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Parsing-problems-using-a-DSL-tp2710491p2710491.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] Parsing problems using a DSL
Trying to bind a variable on the left hand side is a specific example that causes no error to be reported but no DRL to be generated. I can do the binding if I have one re-writing statement per possibility, i.e., There is a first object = object_1 : Car() but not if I generalize it: There is a {nth} object = object_{nth} : Car I have seen limited cases where code seems to be able to be generated with the generalized approach, but it seems to generally fail. My goal here is to use one re-writing statement to handle any number of bindings on variables and objects, as opposed to the cross-product. I.e., I want to avoid There is a first object with a first field {field} = object_1 : Car( field_1_1 : {field} ) There is a second object with a first field {field} = object_2 : Car( field_2_1 : {field} ) There is a first object with a second field {field} = object_1 : Car( field_1_2 : {field} ) There is a second object with a second field {field} = object_1 : Car( field_2_2 : {field} ) since I might have 4 matched objects with 5 matched fields - and there is plenty of other matching logic to consider. Thanks! -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Parsing-problems-using-a-DSL-tp2710491p2710555.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] Limiting rule evaluation--not firing
All, Please let me re-emphasize something from my e-mail: for the general case [eager evaluation] is still better than doing selective evaluation. Unless you are having performance problems for your specific use case, you should not be worrying about this, as the engine is optimized for the general use case. If you *are* having performance problems, then there is a number of possible factors that need to be analyzed, one of which is the possible use of control facts to prevent beta evaluation. So, don't think that control facts are a general solution that will work for everybody... it is quite the opposite, control facts are only worth for a minority of very specific cases, because depending on your situation, it might be very costly to do the phase switch on a control fact. Regarding the question on the rule-flow optimizations, there are optimizations there... for instance, activations don't go into the main agenda until the rule-flow group is activated, and it is usually much cheaper to maintain activations in the separate groups than it is to maintain them on the main agenda... Edson 2011/3/21 FrankVhh frank.vanhoensho...@agserv.eu Hi all, This is a very interesting discussion, so I re-read the Drools Flow manual. IN section 8.1, it is stated as one of the reasons to use rules in your process: Performance: Rule evaluation is optimized. How do I have to understand this? Does rule evaluation only happens for the rules that are in the current ruleflowgroup? Because the above conversation seems to imply it isn't. Regards, Frank Swindells, Thomas wrote: That's probably the best way to go. I think it's a case of experimentation to work out what runs best (and please report your results). Things to consider are what order you have the conditions in the rules (the control fact first is probably most efficient but may be worth comparing with it at the end) and the order you insert facts - do you insert the control fact first or last. Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Vincent Legendre Sent: 21 March 2011 13:47 To: Rules Users List Subject: Re: [rules-users] Limiting rule evaluation--not firing ok. So the only way to do that is to add a control fact, and update it at runtime... Do you think that using the quot;control factquot; method will speed up the execution time for a large ruleset that have different ruleflow-group ? My feeling is yes, especially if quot;firstquot; rules does many updates, but I haven't done any tests. Le 21/03/2011 14:37, Swindells, Thomas a écrit : The thing to remember is that fact evaluation occurs at object insert/update time, not at the point you call fireAllRules. Salience, Agenda and rufeflow control on the other hand are runtime conditions which control which rules are actually activated in what order. Thomas From: rules-users-boun...@lists.jboss.orglt;mailto: rules-users-boun...@lists.jboss.orggt; [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Vincent Legendre Sent: 21 March 2011 13:34 To: Rules Users List Subject: Re: [rules-users] Limiting rule evaluation--not firing And what about ruleflow-group ? There is no network filtering for that too ? The ruleflow-group behaves like an agenda filter, but still evaluate all nodes ? Could we imagine setting quot;tagsquot; to nodes, and stop propagation for node that does not declare the current task tag ? Le 21/03/2011 14:20, Edson Tirelli a écrit : The algorithm as is does eager evaluation, as for the general case that is still better than doing selective evaluation. If, in your case, the decision of which rules to fire is an arbitrary application decision, and not based on the actual constraints of the rules themselves, then the only way would be by creating a control fact: rule 1 when ControlFact( phase == Phase.ONE ) ... rule 2 when ControlFact( phase == Phase.TWO ) ... This way, if the control fact is the first pattern in each rule it effectively disables all the beta evaluations for rules of phases other than the current one. Just be aware that by blocking the eager evaluation this way, phase switches are heavier than without the control fact, where most constraints were already previously evaluated. Obvious, but worth saying out loud... :) There is also a feature that Leonardo is working on that makes the engine automatically unlink and relink parts of the network, based on the existence and possibility of matching the other required facts in a rule LHS. It might achieve similar results to what you are looking for in some cases, but that is totally based on the constraints in there and not on any arbitrary application decision. Edson
Re: [rules-users] Parsing problems using a DSL
On 21 March 2011 16:58, drdaveg drda...@gmail.com wrote: I have run into a number of problems using a domain specific language (DSL) on processing DSLR files. My biggest frustration - and one I am hoping people can provide a work-around or guidance on - is that often the Eclipse plug-in does not allow the DRL pane, showing the DRL file, to be clicked on (and shown.) This sometimes happens when there are no compilation errors: the DLR file is simply not being generated. I have run into issues where an error like parsing problem: contact the support team occurs or a null pointer exception occurs, but no error is shown. My approach has been to make small changes in working DSL files (i.e., describing the translations) at a time, to minimize impact. Can anyone offer better approaches to building the DSL grammar? The upcoming version 5.2 will have better error reporting and new debug facilities for DSL/DSLR expansion. Also, the substitution of partial names for binding variables should work with this new version. On a related issue, many documents cite using DSL and regular expressions for code-rewriting and - while I find documentation on antlr 3 masks for doing some regular expressions - is the common re-writing task of using or - as in My object (Car|Bus|Buyer|Salesman) supported in any way other than seperate lines for object Car, object Bus, etc? Thanks! I can't quite follow you here. From a user's point of view, antlr3 has nothing to do with DSL. If you could provide examples in DRL for what you want to express in DSL/DSLR? -W -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Parsing-problems-using-a-DSL-tp2710491p2710491.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
Re: [rules-users] Parsing problems using a DSL
I have some more incite into what might be causing the problem. Once I remove the drools.package file - which shouldn't be needed since the imports and expander are in the .dslr file - and have a trivial example - I can see an DSL Rule Translation: Array out of bounds exception generated in Eclipse several *minutes* later. My DSL makes no mention of arrays and, in this simplest case, am generating object1 : Car() where object1 and Car are mappings. Once the exception is generated and the dialog box clicked on, you can see the correct translation in the DLR file. Thus, I believe 1. the translator is grinding in an infinite loop, probably just before the file is closed and 2. The exception closes the (correctly translated) file. Is there some token (other than end) that should be included in the .dslr file to ensure the file closes properly? I don't see any control characters present in the file when I open it in a variety of editors. On antlr, I was referring to an article at http://blog.athico.com/search/label/DSL%20regexp%20antlr that discusses the development of Drools. Thanks! -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Parsing-problems-using-a-DSL-tp2710491p2711243.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] Parsing problems using a DSL
Sorry to not include this earlier, but the exeption (where I am developing on another machine) disappeared before. It is exactly: DSL Rule Translation Error! Reason: java.lang.ArrayIndexOutOfBoundsException: 16 and my .dslr file has exactlly 16 lines. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Parsing-problems-using-a-DSL-tp2710491p2711256.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] Sliding windows and event retraction
Hello, I am using sliding windows in the form: Obj(..) over window:length(1) from entry-point EP1 Where many events are being inserted into EP1. Reading the documentation I expected Drools to infer from the window length that all events on EP1 apart from the latest one can be retracted, is this correct? The reason I ask is that I am not seeing retraction of events from EP1 when I debug the session, and I am see behaviour which suggests the rule is firing against old events on the entry point. Basically I want to get to simulate that an entry point can only contain one event at any point in time and that this event is the latest one to arrive. Thanks, James -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Sliding-windows-and-event-retraction-tp2711810p2711810.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] KnowledgeAgent Issue
Hi all, I am trying to use a Knowledge Agent in 5.1.1 with a change set with a few different packages and resource types in it, and I am running into a problem where it is not adding all the packages. Looking at the code I can see that KnowledegeAgentImpl.createPackageFromResource has the following code when it loads a resource: if (kbuilder.getKnowledgePackages().iterator().hasNext()) { return (KnowledgePackageImp) kbuilder.getKnowledgePackages().iterator().next(); } and KnowledgeBuilderImpl.getKnowledgePackages does the following: Package[] pkgs = pkgBuilder.getPackages(); ListKnowledgePackage list = new ArrayListKnowledgePackage( pkgs.length ); and PackageBuilder.getPackages does the following: for ( PackageRegistry pkgRegistry : this.pkgRegistryMap.values() ) { Package pkg = pkgRegistry.getPackage(); // add package to array } pkgRegistryMap is implemented as a HashMap however so the order the packages are returned in is not guaranteed. I seem to be hitting this problem. This is a hard one to create a unit test for so I wanted to check that my analysis is correct before raising a bug. Perhaps using a LinkedHashMap or similar would fix it? thanks Steve ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] KnowledgeAgent Issue
Someone mentioned me the problem some time ago. I have a fix for it in my local repo, butI was waiting for the trunk to be stable to test it. The problem is that under certain circumstances, the kagent is reusing the same kbuilder to compile all the resources present in a change-set (the modifications I have force the agent to use a new kbuilder for each resource). The only difference between what you are reporting and the problem I'm talking about is that in my case all the rules, functions, etc were added to the kbase, but all within the same package. No matter the real package definition. Is this your case also? Please file a bug report and let me know. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2011/3/21 Steven Williams stevearoo...@gmail.com Hi all, I am trying to use a Knowledge Agent in 5.1.1 with a change set with a few different packages and resource types in it, and I am running into a problem where it is not adding all the packages. Looking at the code I can see that KnowledegeAgentImpl.createPackageFromResource has the following code when it loads a resource: if (kbuilder.getKnowledgePackages().iterator().hasNext()) { return (KnowledgePackageImp) kbuilder.getKnowledgePackages().iterator().next(); } and KnowledgeBuilderImpl.getKnowledgePackages does the following: Package[] pkgs = pkgBuilder.getPackages(); ListKnowledgePackage list = new ArrayListKnowledgePackage( pkgs.length ); and PackageBuilder.getPackages does the following: for ( PackageRegistry pkgRegistry : this.pkgRegistryMap.values() ) { Package pkg = pkgRegistry.getPackage(); // add package to array } pkgRegistryMap is implemented as a HashMap however so the order the packages are returned in is not guaranteed. I seem to be hitting this problem. This is a hard one to create a unit test for so I wanted to check that my analysis is correct before raising a bug. Perhaps using a LinkedHashMap or similar would fix it? thanks Steve ___ 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] KnowledgeAgent Issue
I'm not sure whether they were added or not. I noticed the rules weren't running when I expected them to though, so perhaps not. I have worked around it by putting all my rules in the same package - luckily I only had about 30 different rule files, but it is a less than ideal solution. Once I have everything working and checked in on my project I'll test further to see what is going on. Steve On Tue, Mar 22, 2011 at 2:43 PM, Esteban Aliverti esteban.alive...@gmail.com wrote: Someone mentioned me the problem some time ago. I have a fix for it in my local repo, butI was waiting for the trunk to be stable to test it. The problem is that under certain circumstances, the kagent is reusing the same kbuilder to compile all the resources present in a change-set (the modifications I have force the agent to use a new kbuilder for each resource). The only difference between what you are reporting and the problem I'm talking about is that in my case all the rules, functions, etc were added to the kbase, but all within the same package. No matter the real package definition. Is this your case also? Please file a bug report and let me know. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2011/3/21 Steven Williams stevearoo...@gmail.com Hi all, I am trying to use a Knowledge Agent in 5.1.1 with a change set with a few different packages and resource types in it, and I am running into a problem where it is not adding all the packages. Looking at the code I can see that KnowledegeAgentImpl.createPackageFromResource has the following code when it loads a resource: if (kbuilder.getKnowledgePackages().iterator().hasNext()) { return (KnowledgePackageImp) kbuilder.getKnowledgePackages().iterator().next(); } and KnowledgeBuilderImpl.getKnowledgePackages does the following: Package[] pkgs = pkgBuilder.getPackages(); ListKnowledgePackage list = new ArrayListKnowledgePackage( pkgs.length ); and PackageBuilder.getPackages does the following: for ( PackageRegistry pkgRegistry : this.pkgRegistryMap.values() ) { Package pkg = pkgRegistry.getPackage(); // add package to array } pkgRegistryMap is implemented as a HashMap however so the order the packages are returned in is not guaranteed. I seem to be hitting this problem. This is a hard one to create a unit test for so I wanted to check that my analysis is correct before raising a bug. Perhaps using a LinkedHashMap or similar would fix it? thanks Steve ___ 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