[rules-users] Temporal reasoning with external persistence not working
I am trying to use an external storage for loading and persisting objects. But when I try a set a temporal reasoning rule it start to fail. The rule, test code and exception are given below. Please help // rules file package foo.externalwm; global foo.ExternalStorage session; import foo.externalwm.YUser import foo.externalwm.Test declare User @role(event) end declare Contest @role(event) end rule test dialect java when $c1:Contest() from session.getContestByName(Contest1) User(this after[0,3m] $c1) from session.getUserByIndex(0) then System.out.println(rule fired); end // code public class Test { public static void main(String[] args) throws Exception { KnowledgeBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); config.setOption( EventProcessingOption.STREAM ); KnowledgeBase k = init(); // read and compile rules done here final StatefulKnowledgeSession ksession = k.newStatefulKnowledgeSession(); ExternalStorage session = new ExternalStorage(); ksession.setGlobal(session, session); ksession.fireAllRules(); } ***EXCEPTION Exception in thread main org.drools.RuntimeDroolsException: Unexpected exception executing action org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@669a4cb at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:730) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699) at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218) at foo.externalwm.Test.main(Test.java:55) Caused by: java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle at org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedLeft(AfterEvaluatorDefinition.java:332) at org.drools.rule.VariableRestriction.isAllowedCachedLeft(VariableRestriction.java:110) at org.drools.rule.VariableConstraint.isAllowedCachedLeft(VariableConstraint.java:111) at org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaConstraints.java:127) at org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:274) at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:137) at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189) at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64) at org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:279) at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:137) at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189) at org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:138) at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:141) at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59) at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185) at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143) at org.drools.reteoo.Rete.assertObject(Rete.java:107) at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:260) at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:343) at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:994) ... 4 more -- View this message in context: http://drools.46999.n3.nabble.com/Temporal-reasoning-with-external-persistence-not-working-tp3158399p3158399.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Class not found Exception dynamically loadind DRLs
Hi there, we try to load small rule packages containing java classes to be provided as globals and drl-definitions from a webserver using an URLClassloader. the globalsclasses could be read and their tests are ok, but as soon as a drl-file is loded which references souch a dynamically loaded globals2 class, a class no found-Exception is fired. That could be expaned with the differenz class loaders used - the URLClassloader for loading the globals-Classes and the standard class loader used to load the drl-files via kbuilder.add( resourceFactory.newUrlResource(url), ResourceType.DRL); Is there any solution for this problem. Thanks in advance --Ulrich -- View this message in context: http://drools.46999.n3.nabble.com/Class-not-found-Exception-dynamically-loadind-DRLs-tp3158496p3158496.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools and ArrayList
Sorry I'm not quire sure I'm following your errors... Are you saying you are having null pointer exceptions with this version: global List list rule count from global List - but don't do it when Number( $i: intValue ) from accumulate( Person( age 20 ) from list, count(1) ) then System.out.println( $i + Persons ); end -- View this message in context: http://drools.46999.n3.nabble.com/Drools-and-ArrayList-tp3140821p3158948.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Class not found Exception dynamically loadind DRLs
Problem is soved by submitting the used URLClassLoader to both, KnowledgeBuilderFactory and KnowledgeBase. -- View this message in context: http://drools.46999.n3.nabble.com/Class-not-found-Exception-dynamically-loadind-DRLs-tp3158496p3158965.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Fact Types and Processes not found in package after upgrading Guvnor / Drools to 5.2.0.Final and JBPM to 5.1.0.Final
The project I am working on is using JBPM 5.1.0.M1 and Guvnor / Drools 5.2.0.M2. We are using guvnor to house our business rules, fact types, and business processes, and pull those down to our application using a knowledge agent. When using the versions mentioned above everything works fine, but once I upgrade JBPM to 5.1.0.Final and Guvnor / Drools to 5.2.0.Final, my application is no longer able to find my fact type or processes that are in the package. After I upgrade Guvnor to 5.2.0.Final and rebuild all of my packages, which work fine, and if I manually download the package and open it in notepad, I can see the process and fact type names in the package, but as I mentioned when I load the package through the knowledge agent, my processes and fact types are not available to me. Thanks in advance for any help that is provided. -- View this message in context: http://drools.46999.n3.nabble.com/Fact-Types-and-Processes-not-found-in-package-after-upgrading-Guvnor-Drools-to-5-2-0-Final-and-JBPM-l-tp3159015p3159015.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Starting Guvnor in Eclipse
Hi all, any Eclipse users around here? I have followed the instructions here: https://github.com/droolsjbpm/droolsjbpm-build-bootstrap/blob/master/README.md for Eclipse Helios+EGit+m2eclipse. I downloaded 5.2.0.Final from https://github.com/droolsjbpm/guvnor.git, imported all Maven projects it could find in the directory (except guvnor-docs which misses something and I didn't care). The Guvnor application will start in development mode, but: - Firefox is causing often 100% CPU with it (might be the development mode) - Eclipse Development Mode view shows LOTS of errors like this: [ERROR] [org.drools.guvnor.Guvnor] - Errors in 'file:/C:/PocDev/GitHome/git/guvnor/droolsjbpm-ide-common/src/test/java/org/drools/ide/common/client/modeldriven/SuggestionCompletionEngineTest.java' [ERROR] [org.drools.guvnor.Guvnor] - Line 47: No source code is available for type org.drools.ide.common.server.rules.SuggestionCompletionLoader; did you forget to inherit a required module? [ERROR] [org.drools.guvnor.Guvnor] - Line 49: No source code is available for type java.util.jar.JarInputStream; did you forget to inherit a required module? Again, one can work also like this but seeing hundreds of errors is not helping at all when I try to tinker with something somewhere. Plus there's the 100% CPU thing... where and what should I inherit more than Maven is configured already to inherit? Tinkering around: - I set all other projects as dependencies - I set to export all sources from all projects (but there it bitches also about missing java.util sources, who cares about these?)... - added all these sources to the run configuration nothing changed, I still have the above errors from both system libraries AND project dependencies. Or do I experience the problem mentioned in this message? http://markmail.org/message/h52xvo4j52msambe#query:+page:1+mid:lg4mlgiof4giuiaq+state:results Thanks for any hints, JC ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Detection of Rule inconsistences?
Here is a list of things that Verifier can currently do: http://community.jboss.org/wiki/DroolsVerifier It does just what your mentioned, uses Drools to verify Drools. You can extend the Verifier rules with your own if you want to. Toni Rikkola On Jul 11, 2011, at 4:45 PM, Michael Anstis wrote: drools-verifier does this to an extent (that I believe can be extended). Toni Rikkola will know more about it. On 11 July 2011 14:10, Andre morpheusan...@web.de wrote: has anybody thought of controlling rule consistency of drools with drools? or are there features drools has? -- View this message in context: http://drools.46999.n3.nabble.com/Detection-of-Rule-inconsistences-tp3159127p3159127.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users 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] Writting a fusion query with specific time intervals
yes it is a fixed window. How to use the 'cron timers' in a rule file I am bit new to fusion. so if you show me an article or a code segment regarding this that would be fine. And also how to run a rule just after an event appears? thanks, Amila. -- View this message in context: http://drools.46999.n3.nabble.com/Writting-a-fusion-query-with-specific-time-intervals-tp3151010p3159730.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Starting Guvnor in Eclipse
If I am not mistaken you have created a launch configuration in Eclipse for Guvnor (nothing wrong there, I do the same). What you need to do is manually delete all references to test resources in the launch configuration classpath. The apparant lock-up is GWT compliling JScript from the Java code. It can be made quicker by:- * Ensuring no test resources are on the lanch configuration (which will also remove the errors) * Using the FastCompiledGuvnor module (which only compiles for en_US and Firefox - gecko1_8). On 11 July 2011 15:10, Justin Case send_lotsa_spam_h...@yahoo.com wrote: Hi all, any Eclipse users around here? I have followed the instructions here: https://github.com/droolsjbpm/droolsjbpm-build-bootstrap/blob/master/README.md for Eclipse Helios+EGit+m2eclipse. I downloaded 5.2.0.Final from https://github.com/droolsjbpm/guvnor.git, imported all Maven projects it could find in the directory (except guvnor-docs which misses something and I didn't care). The Guvnor application will start in development mode, but: - Firefox is causing often 100% CPU with it (might be the development mode) - Eclipse Development Mode view shows LOTS of errors like this: [ERROR] [org.drools.guvnor.Guvnor] - Errors in 'file:/C:/PocDev/GitHome/git/guvnor/droolsjbpm-ide-common/src/test/java/org/drools/ide/common/client/modeldriven/SuggestionCompletionEngineTest.java' [ERROR] [org.drools.guvnor.Guvnor] - Line 47: No source code is available for type org.drools.ide.common.server.rules.SuggestionCompletionLoader; did you forget to inherit a required module? [ERROR] [org.drools.guvnor.Guvnor] - Line 49: No source code is available for type java.util.jar.JarInputStream; did you forget to inherit a required module? Again, one can work also like this but seeing hundreds of errors is not helping at all when I try to tinker with something somewhere. Plus there's the 100% CPU thing... where and what should I inherit more than Maven is configured already to inherit? Tinkering around: - I set all other projects as dependencies - I set to export all sources from all projects (but there it bitches also about missing java.util sources, who cares about these?)... - added all these sources to the run configuration nothing changed, I still have the above errors from both system libraries AND project dependencies. Or do I experience the problem mentioned in this message? http://markmail.org/message/h52xvo4j52msambe#query:+page:1+mid:lg4mlgiof4giuiaq+state:results Thanks for any hints, JC ___ 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] AgendaGroup and AgendaFilter
Hi, Previous Code from drools 3.x: Below is an example of overridden method in a class that implemented org.drools.spi.AgendaFilter public boolean accept(Activation activation) { boolean evaluateRule = false; String agendaGroup = activation.getRule().getAgendaGroup(); if (functionalArea.equalsIgnoreCase(agendaGroup) { evaluateRule = true; } return evaluateRule; } Drools 5.x Now I have changed the implementation to org.drools.runtime.rule.AgendaFilter How do I re-write the bold-italic line inside the method when variable activation is now an instance of org.drools.runtime.rule.Activation; It doesn't support activation.getRule().getAgendaGroup(); Thanks, saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Drools firing wrong rules
Hi everyone, I have a couple of rules, I just want to show a message when one of the fields is null and heres my code: 21. | rule 'rule1' 22. | salience 9990 23. | when 24. | Cuscar(bgm.size 0 bgm[0].c1001== null ); 25. | then 26. | logger.log(Rule 1 activated); 27. | 28. | end 29. | 30. | rule 'rule2' 31. | salience 9970 32. | when 33. | Cuscar(bgm.size 0 bgm[0].c1004== null ); 34. | then 35. | logger.log(Rule 2 activated); 36. | 37. | end And here's the result: Scenario #1 http://drools.46999.n3.nabble.com/file/n3160376/debug2.jpg with this values when I call fire all rules I dont get any message (its ok because none of the elements is null) Scenario #2 http://drools.46999.n3.nabble.com/file/n3160376/debug1.jpg with this values when I call fire all rules both rules are fired so i get both messages Rule 1 activated and Rule 2 activated (Incorrect - it should only fire rule number 1 cause only the element c1001 is null) Scenario #3 http://drools.46999.n3.nabble.com/file/n3160376/debug3.jpg with this values when I call fire all rules I dont get any message (Incorrect - it should activate rule number 2) This is my model: http://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar Can anybody help me please?, I dont know what am I doing wrong, thank you very much :) -- View this message in context: http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160376.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools firing wrong rules
It is not possible to know, looking only at the screenshots that you sent, what is the problem. Are the values null at the time you insert them into the session? If you modify them after inserting them into the session, are you properly notifying the engine? Edson 2011/7/11 pamerida elp...@hotmail.com Hi everyone, I have a couple of rules, I just want to show a message when one of the fields is null and heres my code: 21. | rule 'rule1' 22. | salience 9990 23. | when 24. | Cuscar(bgm.size 0 bgm[0].c1001== null ); 25. | then 26. | logger.log(Rule 1 activated); 27. | 28. | end 29. | 30. | rule 'rule2' 31. | salience 9970 32. | when 33. | Cuscar(bgm.size 0 bgm[0].c1004== null ); 34. | then 35. | logger.log(Rule 2 activated); 36. | 37. | end And here's the result: Scenario #1 http://drools.46999.n3.nabble.com/file/n3160376/debug2.jpg with this values when I call fire all rules I dont get any message (its ok because none of the elements is null) Scenario #2 http://drools.46999.n3.nabble.com/file/n3160376/debug1.jpg with this values when I call fire all rules both rules are fired so i get both messages Rule 1 activated and Rule 2 activated (Incorrect - it should only fire rule number 1 cause only the element c1001 is null) Scenario #3 http://drools.46999.n3.nabble.com/file/n3160376/debug3.jpg with this values when I call fire all rules I dont get any message (Incorrect - it should activate rule number 2) This is my model: http://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar Can anybody help me please?, I dont know what am I doing wrong, thank you very much :) -- View this message in context: http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160376.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- 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 firing wrong rules
Yes that's right.. can you share some tests to see how you are inserting the facts? 2011/7/11 Edson Tirelli ed.tire...@gmail.com It is not possible to know, looking only at the screenshots that you sent, what is the problem. Are the values null at the time you insert them into the session? If you modify them after inserting them into the session, are you properly notifying the engine? Edson 2011/7/11 pamerida elp...@hotmail.com Hi everyone, I have a couple of rules, I just want to show a message when one of the fields is null and heres my code: 21. | rule 'rule1' 22. | salience 9990 23. | when 24. | Cuscar(bgm.size 0 bgm[0].c1001== null ); 25. | then 26. | logger.log(Rule 1 activated); 27. | 28. | end 29. | 30. | rule 'rule2' 31. | salience 9970 32. | when 33. | Cuscar(bgm.size 0 bgm[0].c1004== null ); 34. | then 35. | logger.log(Rule 2 activated); 36. | 37. | end And here's the result: Scenario #1 http://drools.46999.n3.nabble.com/file/n3160376/debug2.jpg with this values when I call fire all rules I dont get any message (its ok because none of the elements is null) Scenario #2 http://drools.46999.n3.nabble.com/file/n3160376/debug1.jpg with this values when I call fire all rules both rules are fired so i get both messages Rule 1 activated and Rule 2 activated (Incorrect - it should only fire rule number 1 cause only the element c1001 is null) Scenario #3 http://drools.46999.n3.nabble.com/file/n3160376/debug3.jpg with this values when I call fire all rules I dont get any message (Incorrect - it should activate rule number 2) This is my model: http://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jarhttp://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jarrules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar Can anybody help me please?, I dont know what am I doing wrong, thank you very much :) -- View this message in context: http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160376.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- 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 -- - 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 firing wrong rules
On 11/07/2011 23:47, Mauricio Salatino wrote: Yes that's right.. can you share some tests to see how you are inserting the facts? and make sure it's drools 5.2 Mark 2011/7/11 Edson Tirelli ed.tire...@gmail.com mailto:ed.tire...@gmail.com It is not possible to know, looking only at the screenshots that you sent, what is the problem. Are the values null at the time you insert them into the session? If you modify them after inserting them into the session, are you properly notifying the engine? Edson 2011/7/11 pamerida elp...@hotmail.com mailto:elp...@hotmail.com Hi everyone, I have a couple of rules, I just want to show a message when one of the fields is null and heres my code: 21. | rule 'rule1' 22. | salience 9990 23. | when 24. | Cuscar(bgm.size 0 bgm[0].c1001== null ); 25. | then 26. | logger.log(Rule 1 activated); 27. | 28. | end 29. | 30. | rule 'rule2' 31. | salience 9970 32. | when 33. | Cuscar(bgm.size 0 bgm[0].c1004== null ); 34. | then 35. | logger.log(Rule 2 activated); 36. | 37. | end And here's the result: Scenario #1 http://drools.46999.n3.nabble.com/file/n3160376/debug2.jpg with this values when I call fire all rules I dont get any message (its ok because none of the elements is null) Scenario #2 http://drools.46999.n3.nabble.com/file/n3160376/debug1.jpg with this values when I call fire all rules both rules are fired so i get both messages Rule 1 activated and Rule 2 activated (Incorrect - it should only fire rule number 1 cause only the element c1001 is null) Scenario #3 http://drools.46999.n3.nabble.com/file/n3160376/debug3.jpg with this values when I call fire all rules I dont get any message (Incorrect - it should activate rule number 2) This is my model: http://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar http://drools.46999.n3.nabble.com/file/n3160376/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jarrules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar Can anybody help me please?, I dont know what am I doing wrong, thank you very much :) -- View this message in context: http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160376.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org mailto: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 http://www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org mailto: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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] AgendaGroup and AgendaFilter
On 11/07/2011 20:43, Saleem Lakhani wrote: Hi, _Previous Code from drools 3.x:_ Below is an example of overridden method in a class that implemented *org.drools.spi.AgendaFilter* public boolean accept(Activation activation) { boolean evaluateRule = false; */String agendaGroup = activation.getRule().getAgendaGroup();/* if (functionalArea.equalsIgnoreCase(agendaGroup) { evaluateRule = true; } return evaluateRule; } *_Drools 5.x_* Now I have changed the implementation to *org.drools.runtime.rule.AgendaFilter* ** How do I re-write the bold-italic line inside the method when variable activation is now an instance of *org.drools.runtime.rule.Activation;* It doesn't support */activation.getRule().getAgendaGroup();/* We have no made those public yet. We've kept Rule, like much of -api, minimal. rule groups in general need a rethink and I don't want to bloat the api. What you can do for now is cast to org.drools.rule.Rule to get that information, just remember that it's a deprecated class and can be changed on any release. Mark *//* Thanks, saleem ___ 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 firing wrong rules
Hi.. sorry I didnt include all the information... heres the class Im using http://drools.46999.n3.nabble.com/file/n3160827/ruleInvoker.java ruleInvoker.java I use the method invocarReglas... I dont modify any fact, the values I show there are set before I insert the fact into the session... Im using drools 5.2 thanks for your help -- View this message in context: http://drools.46999.n3.nabble.com/Drools-firing-wrong-rules-tp3160376p3160827.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] why the new release 5.2 got war files specific to Jboss and tomcat not WAS server
Hi, Is Guvnor is compatible with Websphere server, if so why the new release 5.2 got war files specific to Jboss and tomcat. why not to have a common war like 5.1 version? Thanks, Prabakar ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Any suggestions to implement exclusions and avoid update
Hi, Below are 2 rules, rule1 has higher precedence than rule2. Rule2 should not execute if Rule 1 executes. 1) One way to get this working is to check the null value. 2) If the update is not called, the Rule2 gets executed using the previous null value of potentialTheftRating. Is there any other way to implement this requirement. rule Rule 1 PotentialTheft0 ruleflow-group TheftRating0 salience 10 no-loop lock-on-active when $client : Client() $policy : Service(productType == Vehicle Insurance) from $client.service $car : Vehicle(potentialTheftRating == null, vehicleType == vehicleTypeType.CAR, convertible == Boolean.TRUE) from $policy.vehicle then modify ($car) { setPotentialTheftRating( potentialTheftRatingType.HIGH ) } update($client); end rule Rule2 PotentialTheft0 ruleflow-group TheftRating0 no-loop lock-on-active when $client : Client() $policy : Service(productType == Vehicle Insurance) from $client.service $car : Vehicle(potentialTheftRating == null,vehicleType == vehicleTypeType.CAR, price = 2, price = 45000, highTheftProbabilty == Boolean.FALSE ) from $policy.vehicle then modify ($car) { setPotentialTheftRating( potentialTheftRatingType.MODERATE ) } update($client); end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users