[rules-users] Refreshing RuleBase using the Guvnor
I posted about caching and after some more investigation it appears the problem lies in just refreshing the rulebase. I created a simple package that contains 1 excel decision table which has 1 rule [row] in it. I ran my application. Then rebuilt the package in the Guvnor and my application refreshed the rule base correctly. I have other packages which contain many 100 rules if not 1000 rules all based on multiple excel based decision tables. If I run my application, then rebuild the package in the Guvnor, my application throws the exception. RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010): java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory. Stack trace should follow. org.drools.RuntimeDroolsException: java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory It appears the problem occurs where there are many rules. Any ideas? Thanks. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Refreshing Rule Base
I posted about caching and after some more investigation it appears the problem lies in just refreshing the rulebase. I created a simple package that contains 1 excel decision table which has 1 rule [row] in it. I ran my application. Then rebuilt the package in the Guvnor and my application refreshed the rule base correctly. I have other packages which contain many 100 rules if not 1000 rules all based on multiple excel based decision tables. If I run my application, then rebuild the package in the Guvnor, my application throws the exception. RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010): java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory. Stack trace should follow. org.drools.RuntimeDroolsException: java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory It appears the problem occurs where there are many rules. Any ideas? Thanks. From: rules-users-boun...@lists.jboss.org on behalf of Jeffrey Schneller Sent: Fri 2/26/2010 12:18 PM To: rules-users@lists.jboss.org Subject: [rules-users] Caching RuleBase I saw some old thread about caching the rule base on your own. I have a singleton which contains a hashmap to do the caching. I am using the Guvnor to pull my rules from. This works fine except when the rules change on the Guvnor. When the rule base tries to refresh in my application, I am getting a ClassCastException. Any ideas? RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010): java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory. Stack trace should follow. org.drools.RuntimeDroolsException: java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory My code to do the caching is below: private HashMap ruleBaseMap = new HashMap(); // check to see if we already set up this rule base if (ruleBaseMap.containsKey(product.getConfigurationRule())) { rb = ruleBaseMap.get(product.getConfigurationRule()); } else { try { InitialContext context = new InitialContext(); url = (String) context.lookup("java:comp/env/rules.url"); url = url + product.getConfigurationRule() + "/LATEST"; } catch (NamingException e1) { } Properties config = new Properties(); config.setProperty("newInstance", "false"); config.setProperty("url", url); config.setProperty("poll", "300"); config.setProperty("name", "Assembly"); RuleAgent agent = RuleAgent.newRuleAgent(config); rb = agent.getRuleBase(); ruleBaseMap.put(product.getConfigurationRule(), rb); } <>___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Problem running drools-verifier ant task
I'm trying to run the verifier against a simple rule file I've created. My rules live in a directory called "rules". The rules files are directly under rules/. rules/rule1.drl rules/rule2.drl My ant target looks like: I'm getting this exception: java.lang.NullPointerException at java.io.Reader.(Reader.java:61) at java.io.InputStreamReader.(InputStreamReader.java:55) at org.drools.contrib.DroolsVerifierAntTask.compileAndAnalyzeFile(DroolsVerifierAntTask.java:125) at org.drools.contrib.DroolsVerifierAntTask.execute(DroolsVerifierAntTask.java:105) The error occurs in compileAndAnalyzeFiles: http://grepcode.com/file/repository.jboss.com/maven2/org.drools/drools-ant/5.1.0.M1/org/drools/contrib/DroolsVerifierAntTask.java#DroolsVerifierAntTask.compileAndAnalyzeFile%28org.drools.verifier.Verifier,java.lang.String%29 The line it's bombing out seems to be trying to find my rules file relative to the Verifier class: org.drools.lang.descr.PackageDescr descr = (new DrlParser()).parse(new InputStreamReader(org/drools/verifier/Verifier.getResourceAsStream(filename))); Why does it do that? Why not just read the file I specify? Do I have to muck with the classpath to get the verifier to work? Thanks, Adam -- View this message in context: http://n3.nabble.com/Problem-running-drools-verifier-ant-task-tp417853p417853.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] Caching RuleBase
I saw some old thread about caching the rule base on your own. I have a singleton which contains a hashmap to do the caching. I am using the Guvnor to pull my rules from. This works fine except when the rules change on the Guvnor. When the rule base tries to refresh in my application, I am getting a ClassCastException. Any ideas? RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010): java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory. Stack trace should follow. org.drools.RuntimeDroolsException: java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory My code to do the caching is below: private HashMap ruleBaseMap = new HashMap(); // check to see if we already set up this rule base if (ruleBaseMap.containsKey(product.getConfigurationRule())) { rb = ruleBaseMap.get(product.getConfigurationRule()); } else { try { InitialContext context = new InitialContext(); url = (String) context.lookup("java:comp/env/rules.url"); url = url + product.getConfigurationRule() + "/LATEST"; } catch (NamingException e1) { } Properties config = new Properties(); config.setProperty("newInstance", "false"); config.setProperty("url", url); config.setProperty("poll", "300"); config.setProperty("name", "Assembly"); RuleAgent agent = RuleAgent.newRuleAgent(config); rb = agent.getRuleBase(); ruleBaseMap.put(product.getConfigurationRule(), rb); } ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule Templates and null values
It works out of the box. So in this example: 12 rule "Cheese fa...@{row.rownumber}" 13 when 14Person(age == @{age}) 15Cheese(type == "@{type}") 16 then 17list.add("@{log}"); 18 end If you provide age=null, line 14 is not included in the rule automatically. -Ursprüngliche Nachricht- Von: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Pavel Tavoda Gesendet: Freitag, 26. Februar 2010 14:46 An: Rules Users List Betreff: Re: [rules-users] Rule Templates and null values Enlighten us. Where is this method and how to use it? I'm also interested. Palo 2010/2/26 Bernd Rücker : > Okay, digging more into the source code I found the method > replaceOptionals which does exactly what I need. So despite the missing > docs, a line IS skipped if the according parameter used in that line is > null. Perfect :-) > > > > Sorry for the interruption > > > > Von: rules-users-boun...@lists.jboss.org > [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Bernd Rücker > Gesendet: Freitag, 26. Februar 2010 12:30 > An: rules-users@lists.jboss.org > Betreff: [rules-users] Rule Templates and null values > > > > Hi all. > > > > I question myself if I can get the Rule Templates to works like it is in > Excel: If one parameter is not set (null), the whole line of the template > is skipped? > > > > Since we want to build a template for a lot of rules, fed from a database. > There some conditions can be null, so they should not be included in the > rule at all. Has anybody an idea to this? I havent found anything, neither > in the docs, nor in the testcases > > > > Thanks a lot > > Bernd > > > > ___ > 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] Drools Flow / Declarative process definition
Dear Drools team, I like much the approach of Drools Flow and would appreciate to learn more. The documentation states the extended rule engine having knowledge of the process model and instance state derives the next process execution step. I am wondering, whether the overall flow is reactive, even the procedural constructs like sequence, branching/joining are implemented through firing rule actions ? For example, does Drools Flow converts the sequence of steps A -> B into sth. like "when A.passed then B.start()" ? When the prevoius holds, does Drools Flow allows to create (desgin) and execute declarative processes omiting any explicit sequencing ? The steps/tasks were ordered partially by data- or event-based dependency conditions or even activated independently of each other. Drools Flow/Expert provide a thight integration with Java (e.g. representing facts as Java classes). Are there future plans for supporting a higher-level processing with XML/XPath/XQuery like in YAWL ? Many thanks Jaro -- Jaroslav Pullmann Web Compliance Center - Fraunhofer FIT Schloss Birlinghoven, D-53757 Sankt Augustin, Germany Phone: +49-2241-142623Fax: +49-2241-142065 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule Templates and null values
Enlighten us. Where is this method and how to use it? I'm also interested. Palo 2010/2/26 Bernd Rücker : > Okay, digging more into the source code I found the method > “replaceOptionals” which does exactly what I need. So despite the missing > docs, a line IS skipped if the according parameter used in that line is > null. Perfect :-) > > > > Sorry for the interruption… > > > > Von: rules-users-boun...@lists.jboss.org > [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Bernd Rücker > Gesendet: Freitag, 26. Februar 2010 12:30 > An: rules-users@lists.jboss.org > Betreff: [rules-users] Rule Templates and null values > > > > Hi all. > > > > I question myself if I can get the Rule Templates to works like it is in > Excel: If one “parameter” is not set (null), the whole line of the template > is skipped? > > > > Since we want to build a template for a lot of rules, fed from a database. > There some conditions can be null, so they should not be included in the > rule at all. Has anybody an idea to this? I haven’t found anything, neither > in the docs, nor in the testcases… > > > > Thanks a lot > > Bernd > > > > ___ > 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] Persistence issue using Oracle
Hi All, I have been using the H2 in memory database to test all my Drools Flow scenarios using Guvnor and Gwt Console provided. And I have some questions to ask and was wondering if someone can help. The main plan now is to switch from using the H2 in memory database to Persist using the Oracle database. 1- What are the files that should be affected in this switch? or where should I be looking into? 2- Are the tables created dynamically? and under which schema? 3- is there any test case implemented using this technology? Thnx in advance for your help Regards, Ram -- View this message in context: http://n3.nabble.com/Persistence-issue-using-Oracle-tp417257p417257.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] Rule Templates and null values
Okay, digging more into the source code I found the method replaceOptionals which does exactly what I need. So despite the missing docs, a line IS skipped if the according parameter used in that line is null. Perfect :-) Sorry for the interruption Von: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Bernd Rücker Gesendet: Freitag, 26. Februar 2010 12:30 An: rules-users@lists.jboss.org Betreff: [rules-users] Rule Templates and null values Hi all. I question myself if I can get the Rule Templates to works like it is in Excel: If one parameter is not set (null), the whole line of the template is skipped? Since we want to build a template for a lot of rules, fed from a database. There some conditions can be null, so they should not be included in the rule at all. Has anybody an idea to this? I havent found anything, neither in the docs, nor in the testcases Thanks a lot Bernd ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] WSHumanTaskHandler problem solved
the problem was solved actually each workiten was creating a new instance of WSHumanTaskHandler which caused the problem now its fine sorry for inconvithanks love kiranP -- View this message in context: http://n3.nabble.com/WSHumanTaskHandler-problem-in-TaskCompletedHandler-tp417031p417123.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] Rule Templates and null values
Hi all. I question myself if I can get the Rule Templates to works like it is in Excel: If one parameter is not set (null), the whole line of the template is skipped? Since we want to build a template for a lot of rules, fed from a database. There some conditions can be null, so they should not be included in the rule at all. Has anybody an idea to this? I havent found anything, neither in the docs, nor in the testcases Thanks a lot Bernd ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] WSHumanTaskHandler problem in TaskCompletedHandler
i have created a web based application which uses the WSHumanTaskHandler for 2 work items in my project the flow as start-->workitem1-->workItem2-->end and there can be many instances of process running the process use the mina task Server and Client Provided it work fine if there is only one processinstance but if there r more than one than it gets into the place in code of WSHumantaskHandler commented as // defensive check that should never happen, just here for testing and shows that Event.getTaskId() and taskId are diffrent when this should not happen so i m running in a lot of trouble . . . . . can somebody which part of code i must look where such a thing can happen..thanks in advance kiranP -- View this message in context: http://n3.nabble.com/WSHumanTaskHandler-problem-in-TaskCompletedHandler-tp417031p417031.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