[rules-users] 5.3.0 Faster Complation?
Hi, From documentation of 5.3.0: 2.1.1.4. Faster compilation Thanks to many improvements and optimizations made on both MVEL library and Drools internals, the DRL compilation is now at least 3 times faster for both MVEL and Java dialects. Does it really affect the runtime execution of already compiled serialized rules in production? Any technical details will help. Thanks, saleem ___ 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] comma on LHS in dsl
Hi there, I had something like this in drools 3.0 and it used to work but after I upgraded to drools 5.0 it doesn't work. [when]The Roof is not Type A , Type B , Type C , or RC=LM(rda != null, rda != A, rda != B, rda != C, rda != R) But to compile it now I had to make the following changes on both LHS and RHS: [when]The Roof is not Type A not Type B not Type C not RC=LM(rda != null rda != A rda != B rda != C rda != R) Why does the , on the LHS doesn't compile? Thanks, Saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] M1 Vs CR1
Hi guys, Just wanted to know what is the difference b/w Drools 5.2 M1 and Drools 5.2 CR1? Thanks, saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] DSL in Drools 5.2
Can we combine to different DSL rules in DSLR with a Boolean operator? Can we combine them with an OR or AND? e.g; in DSL I have: a or b = Person(name ==a || name ==b) c or d= Person(name==c || name ==d) Can I write in DRL as: a or b or c or d? I know combining them as one rule is easier but I have few limitations; saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] concatenate 2 dsl rules in dslr
Hi, How do I combine 2 different dsl statements in dslr. Example in dsl I have; 1. Kid=Parson(age 15) 2. Adult=Person(age 21) Can I write like this in dslr: Kid or Adult saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] eval in DSL
How do we get this done in Drools 5.2.1: [when]Cov is not equal to {value} percent of Coverage A = eval(math.calculatePercentages(covTO.getCoverage(), covTO.getD()) != {value}) This used to compile in Drools 3. Thanks saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] eval in DSL
Here are the details: This is how my rule looks like: //Imports for TO and MathHelper global com.h.MathHelper math; rule Coverage must equal 20% of Coverage C auto-focus true agenda-group C when Coverage information exists Coverage is not equal to 20 percent of Coverage C then do something end [when]There is a Coverage with=covTO : CovTO() [when]Coverage is not equal to {value} percent of Coverage A=eval(math.calculatePercentage(coveTO.getCoverage(), covTO.getD()) != {value}) Error: Unable to expand: Coverage is not equal to 20 percent of Coverage C[34,2]: [ERR 101] Line 34:2 no viable alternative at input 'Coverage' in rule Coverage must equal 20% of Coverage C[34,20]: [ERR 101] Line 34:20 no viable alternative at input 'equal' in rule Coverage must equal 20% of Coverage C Thanks, saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: Thursday, March 10, 2011 12:42 PM To: Rules Users List Subject: Re: [rules-users] eval in DSL Can't help you - not enough context. * What's the error? * How is it used, especially preceding [when] clauses, where covTO ought to get defined -W 2011/3/10 Saleem Lakhani saleem.lakh...@citizensfla.com How do we get this done in Drools 5.2.1: [when]Cov is not equal to {value} percent of Coverage A = eval(math.calculatePercentages(covTO.getCoverage(), covTO.getD()) != {value}) This used to compile in Drools 3. 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] eval in DSL
OMG .. I look so dum now haha J .. thanks though. saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: Thursday, March 10, 2011 1:42 PM To: Rules Users List Subject: Re: [rules-users] eval in DSL The DSRL line ends with ... Coverage C but the DSL definition ends with ...Coverage A -W 2011/3/10 Saleem Lakhani saleem.lakh...@citizensfla.com Here are the details: This is how my rule looks like: //Imports for TO and MathHelper global com.h.MathHelper math; rule Coverage must equal 20% of Coverage C auto-focus true agenda-group C when Coverage information exists Coverage is not equal to 20 percent of Coverage C then do something end [when]There is a Coverage with=covTO : CovTO() [when]Coverage is not equal to {value} percent of Coverage A=eval(math.calculatePercentage(coveTO.getCoverage(), covTO.getD()) != {value}) Error: Unable to expand: Coverage is not equal to 20 percent of Coverage C[34,2]: [ERR 101] Line 34:2 no viable alternative at input 'Coverage' in rule Coverage must equal 20% of Coverage C[34,20]: [ERR 101] Line 34:20 no viable alternative at input 'equal' in rule Coverage must equal 20% of Coverage C Thanks, saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: Thursday, March 10, 2011 12:42 PM To: Rules Users List Subject: Re: [rules-users] eval in DSL Can't help you - not enough context. * What's the error? * How is it used, especially preceding [when] clauses, where covTO ought to get defined -W 2011/3/10 Saleem Lakhani saleem.lakh...@citizensfla.com How do we get this done in Drools 5.2.1: [when]Cov is not equal to {value} percent of Coverage A = eval(math.calculatePercentages(covTO.getCoverage(), covTO.getD()) != {value}) This used to compile in Drools 3. 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Need Help writing then part in DSLR
Hi, This is what used to work in Drools 3: Sample from DSL: [then]A validation error has occurred=ValErrTO valErrTO = new ValErrTO(); java.util.HashMap variableMap = new java.util.HashMap(); [then]- The standard error level is {standard_error_level}=int stdErrLevel={standard_error_level}; valErrTO.setErrorCode(stdErrLevel); With Drools 5.2.1 it gives me the following error: No modify was found to add the modifier to: - The standard error level is 400 How do I write the above 2 statements again in Drools 5.2.1, NOTE: I need to write this in DSL. Sample DSLR: rule Your First Rule when There is a Coverage with then #actions A validation error has occurred - The standard error level is 400 end Thanks, saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Need Help writing then part in DSLR
Thanks. It is working. saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: Wednesday, March 09, 2011 1:57 PM To: Rules Users List Subject: Re: [rules-users] Need Help writing then part in DSLR Omit the '-' from the DSL and the DSLR: [then]The standard error level is ... -W 2011/3/9 Saleem Lakhani saleem.lakh...@citizensfla.com Hi, This is what used to work in Drools 3: Sample from DSL: [then]A validation error has occurred=ValErrTO valErrTO = new ValErrTO(); java.util.HashMap variableMap = new java.util.HashMap(); [then]- The standard error level is {standard_error_level}=int stdErrLevel={standard_error_level}; valErrTO.setErrorCode(stdErrLevel); With Drools 5.2.1 it gives me the following error: No modify was found to add the modifier to: - The standard error level is 400 How do I write the above 2 statements again in Drools 5.2.1, NOTE: I need to write this in DSL. Sample DSLR: rule Your First Rule when There is a Coverage with then #actions A validation error has occurred - The standard error level is 400 end 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] HELP - Problem creating package -validateUniqueRuleNames(PackageBuilder.java:830)
All my rules worked fine with Drools 3. NowI am trying to upgrade to Drools 5. I am using the following jar files to create binary (jar) files for my rules from command line: antlr-runtime.jar, drools-api.jar, drools-compiler.jar, drools-core.jar, drools-decisiontables.jar, drools-jsr94.jar, drools-templates.jar, janino-2.5.15.jar, joda-time.jar, jsr94.jar, jxl.jar, mvel2.jar, xpp3.jar, xpp3_min.jar, xstream.jar, org.eclipse.jdt.core_3.6.1.v_A68_R36x.jar This is my DSLR: package cit.coverage; expander Coverage.dsl rule rrr auto-focus true when He is nice then He is happy end This is my DSL Coverage.dsl: [condition][]He is nice=eval(true) [consequence][]He is happy=eval(System.out.println(HA HA)) I am trying to create binary(jars) using the following code: KnowledgeBuilderConfiguration kbc = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(); kbc.setProperty(drools.dialect.java.compiler, JANINO); KnowledgeBuilder builder = null; builder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbc); Reader drlSource = new InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDrlSourc e())); //ruleset.getDrlSource() = com/cit/myDrl.dslr Reader dslSource = new InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDslSourc e())); builder.add(ResourceFactory.newReaderResource(dslSource), ResourceType.DSL); builder.add(ResourceFactory.newReaderResource(drlSource), ResourceType.DSLR); -- problem KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(builder.getKnowledgePackages()); no matter what I type in my dslr (drl) file I get the following exception on the highlighted line; I have 1 rule or 0 rule it still throws the same exception. Does it have to do with any jar files? Caused by: java.lang.NullPointerException at org.drools.compiler.PackageBuilder.validateUniqueRuleNames(PackageBuilde r.java:830) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:555) at org.drools.compiler.PackageBuilder.addPackageFromDslr(PackageBuilder.jav a:355) at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.j ava:461) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja va:28) saleem -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: Friday, March 04, 2011 2:14 AM To: Rules Users List Subject: Re: [rules-users] Problem creating package -validateUniqueRuleNames(PackageBuilder.java:830) It could be an error in the DSL file. Check for errors after *each* builder.add(...). -W 2011/3/4 Saleem Lakhani saleem.lakh...@citizensfla.com: Following is my code: KnowledgeBuilderConfiguration kbc = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(); kbc.setProperty(drools.dialect.java.compiler, JANINO); KnowledgeBuilder builder = null; builder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbc); Reader drlSource = new InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDrlSourc e())); //ruleset.getDrlSource() = com/cit/myDrl.dslr Reader dslSource = new InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDslSourc e())); builder.add(ResourceFactory.newReaderResource(dslSource), ResourceType.DSL); builder.add(ResourceFactory.newReaderResource(drlSource), ResourceType.DSLR); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(builder.getKnowledgePackages()); no matter what I type in my dslr (drl) file I get the following exception on the highlighted line; ANY IDEA I have 1 rule or No rule it still throws the same exception. Does it have to do with any jar files? Caused by: java.lang.NullPointerException at org.drools.compiler.PackageBuilder.validateUniqueRuleNames(PackageBuilde r.java:830) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:555) at org.drools.compiler.PackageBuilder.addPackageFromDslr(PackageBuilder.jav a:355) at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.j ava:461) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja va:28) 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] HELP - Problem creating package-validateUniqueRuleNames(PackageBuilder.java:830)
Sorry .. no use. I made those changes but nothing different. I'll try 5.2. saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: Friday, March 04, 2011 11:28 AM To: Rules Users List Subject: Re: [rules-users] HELP - Problem creating package-validateUniqueRuleNames(PackageBuilder.java:830) 2011/3/4 Sale This is my DSLR: package cit.coverage; expander Coverage.dsl rule rrr auto-focus true when He is nice then He is happy end This is my DSL Coverage.dsl: [condition][]He is nice=eval(true) [consequence][]He is happy=eval(System.out.println(HA HA)) This is not a correct Java statement, as it should be for the consequence: - eval() is not valid here - There is no semicolon at the end This would be correct: [consequence][]He is happy=System.out.println(HA HA); The NPE should be gone in 5.2.0. -W ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Problem creating package - validateUniqueRuleNames(PackageBuilder.java:830)
Following is my code: KnowledgeBuilderConfiguration kbc = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(); kbc.setProperty(drools.dialect.java.compiler, JANINO); KnowledgeBuilder builder = null; builder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbc); Reader drlSource = new InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDrlSourc e())); //ruleset.getDrlSource() = com/cit/myDrl.dslr Reader dslSource = new InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDslSourc e())); builder.add(ResourceFactory.newReaderResource(dslSource), ResourceType.DSL); builder.add(ResourceFactory.newReaderResource(drlSource), ResourceType.DSLR); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(builder.getKnowledgePackages()); no matter what I type in my dslr (drl) file I get the following exception on the highlighted line; ANY IDEA I have 1 rule or No rule it still throws the same exception. Does it have to do with any jar files? Caused by: java.lang.NullPointerException at org.drools.compiler.PackageBuilder.validateUniqueRuleNames(PackageBuilde r.java:830) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:555) at org.drools.compiler.PackageBuilder.addPackageFromDslr(PackageBuilder.jav a:355) at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.j ava:461) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja va:28) saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] PackageBuilderConfiguration
HI, Has anyone seen this before on Drools 5: java.lang.NoSuchMethodError: org/drools/compiler/PackageBuilderConfiguration.init(Ljava/util/Properties;)V any insight? saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of ioda100 Sent: Wednesday, March 02, 2011 8:06 AM To: rules-users@lists.jboss.org Subject: Re: [rules-users] Guvnor and drools implementation - questions Really thank you, it's working fine. I will see if it's working for my more difficult case. On Tue, Mar 1, 2011 at 11:28 PM, Esteban [via Drools - Java Rules Engine] [hidden email] wrote: You need to create the DSL first. Follow these steps: 1.- Add java.util.Map to package imports (I think you already did this) 2.- Create a new Enumeration with the following content: 'Map.properties': ['prop1', 'prop2', 'prop3'] 3.- Create a new DSL with this content: [when]The property {key:ENUM:Map.properties} of the map is {value}=Map((this[{key}] == {value})) 4.- Create a new Rule and add the DSL sentence to the WHEN part. You should see the drop down. Note the name of the enumeration and how the variable {key} is defined in the DSL. I think you can also read the enumerations from a Java Enum present on your model, but I'm not sure about it. Does anyone know about this? Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2011/3/1 ioda100 [hidden email] http://user/SendEmail.jtp?type=nodenode=2607065i=0 Yes but for this i will be obliged to create a POJO of an object. And for attributes of that object in DSL i can define values that can take this attribute? Maybe i don't understand but i don't see how to do with this. My case : I have Maps in the session. Each Map has for example 5 properties (prop1, prop2, prop3, prop4, prop51) and the value is a string. The Map is MapString, Object but generally Object is a String. So in the When clause i have something like that : $m : Map((this[prop1] == test1)) I have included java.utils.Map in Guvnor. So when i add a when clause i can choose Map in the list but impossible to have prop1 to prop5 in a drop down list for attributes of the Map. Would it be possible to create a Pojo for Map or would it be in conflict with the Map of Java? Thank you for your time Le 1/03/2011 17:55, Vincent Legendre [via Drools - Java Rules Engine] a écrit : Le 01/03/2011 15:39, ioda100 a écrit : Thanks for your quick answer Esteban. 1) Ok i will have a look at DSL. In fact in my map i know all the properties (about 200). It would be cool to be able to have a drop down list with all these attributes as when we do it with objects for which we gave Pojo to Guvnor. You can define enumerations for a particular attribute. Inside a DSL you can constrain a placeholder with that enumeration. And finally, enums can be static, or dynamic (a interface to implement that returns a list of values). search the Guvnor's doc in these chapters 1.4.2.4.8. Data enumerations (drop down list configurations) ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=2604255i=0by-user=t https://lists.jboss.org/mailman/listinfo/rules-users If you reply to this email, your message will be added to the discussion below: http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2604255.html http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2604255.html?by-user=tby-user=tby-user=t To unsubscribe from Guvnor and drools implementation - questions, click here http://drools-java-rules-engine.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2602641code=ZWRkeWhhdXRvdEBnbWFpbC5jb218MjYwMjY0MXwtMTEzMzMwMzAxNA==by-user=tby-user=tby-user=t . View this message in context: Re: Guvnor and drools implementation - questions http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2606843.html?by-user=tby-user=t Sent from the Drools - User mailing list archive http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html?by-user=tby-user=t at Nabble.com. ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=2607065i=1
Re: [rules-users] PackageBuilderConfiguration
Got it fixed. Thanks for looking. saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Saleem Lakhani Sent: Wednesday, March 02, 2011 9:53 AM To: Rules Users List Subject: [rules-users] PackageBuilderConfiguration HI, Has anyone seen this before on Drools 5: java.lang.NoSuchMethodError: org/drools/compiler/PackageBuilderConfiguration.init(Ljava/util/Properties;)V any insight? saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of ioda100 Sent: Wednesday, March 02, 2011 8:06 AM To: rules-users@lists.jboss.org Subject: Re: [rules-users] Guvnor and drools implementation - questions Really thank you, it's working fine. I will see if it's working for my more difficult case. On Tue, Mar 1, 2011 at 11:28 PM, Esteban [via Drools - Java Rules Engine] [hidden email] wrote: You need to create the DSL first. Follow these steps: 1.- Add java.util.Map to package imports (I think you already did this) 2.- Create a new Enumeration with the following content: 'Map.properties': ['prop1', 'prop2', 'prop3'] 3.- Create a new DSL with this content: [when]The property {key:ENUM:Map.properties} of the map is {value}=Map((this[{key}] == {value})) 4.- Create a new Rule and add the DSL sentence to the WHEN part. You should see the drop down. Note the name of the enumeration and how the variable {key} is defined in the DSL. I think you can also read the enumerations from a Java Enum present on your model, but I'm not sure about it. Does anyone know about this? Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2011/3/1 ioda100 [hidden email] http://user/SendEmail.jtp?type=nodenode=2607065i=0 Yes but for this i will be obliged to create a POJO of an object. And for attributes of that object in DSL i can define values that can take this attribute? Maybe i don't understand but i don't see how to do with this. My case : I have Maps in the session. Each Map has for example 5 properties (prop1, prop2, prop3, prop4, prop51) and the value is a string. The Map is MapString, Object but generally Object is a String. So in the When clause i have something like that : $m : Map((this[prop1] == test1)) I have included java.utils.Map in Guvnor. So when i add a when clause i can choose Map in the list but impossible to have prop1 to prop5 in a drop down list for attributes of the Map. Would it be possible to create a Pojo for Map or would it be in conflict with the Map of Java? Thank you for your time Le 1/03/2011 17:55, Vincent Legendre [via Drools - Java Rules Engine] a écrit : Le 01/03/2011 15:39, ioda100 a écrit : Thanks for your quick answer Esteban. 1) Ok i will have a look at DSL. In fact in my map i know all the properties (about 200). It would be cool to be able to have a drop down list with all these attributes as when we do it with objects for which we gave Pojo to Guvnor. You can define enumerations for a particular attribute. Inside a DSL you can constrain a placeholder with that enumeration. And finally, enums can be static, or dynamic (a interface to implement that returns a list of values). search the Guvnor's doc in these chapters 1.4.2.4.8. Data enumerations (drop down list configurations) ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=2604255i=0by-user=t https://lists.jboss.org/mailman/listinfo/rules-users If you reply to this email, your message will be added to the discussion below: http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2604255.html http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2604255.html?by-user=tby-user=tby-user=t To unsubscribe from Guvnor and drools implementation - questions, click here http://drools-java-rules-engine.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=2602641code=ZWRkeWhhdXRvdEBnbWFpbC5jb218MjYwMjY0MXwtMTEzMzMwMzAxNA==by-user=tby-user=tby-user=t . View this message in context: Re: Guvnor and drools implementation - questions http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2606843.html?by-user=tby-user=t Sent from the Drools - User mailing list archive http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html?by-user=tby
Re: [rules-users] PackageBuilderConfiguration
Yes I am. I was using the older version before. saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban Aliverti Sent: Wednesday, March 02, 2011 11:57 AM To: Rules Users List Subject: Re: [rules-users] PackageBuilderConfiguration Are you including drools-compiler in your application? Best, El mar 2, 2011 12:54 p.m., Saleem Lakhani saleem.lakh...@citizensfla.com escribió: Got it fixed. Thanks for looking. saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Saleem Lakhani Sent: Wednesday, March 02, 2011 9:53 AM To: Rules Users List Subject: [rules-users] PackageBuilderConfiguration HI, Has anyone seen this before on Drools 5: java.lang.NoSuchMethodError: org/drools/co... ___ 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] java.lang.RuntimeException: Unexpected global
Hi, What is the actual reason for this error? Why cant drools give some better explaination of this problem when the exception is thrown. Here is the snippet of my code: workingMemory.setGlobal(validationErrorHierarchy, validationErrorHierarchy); //workingMemory is StatefulKnowledgeSession I am using the following variable in dslr: global com.model.ValidationErrorHierarchy validationErrorHierarchy; thanks saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] PackageBuilderConfiguration
I am switching from Drools 2 to 5. Do we still do the following in Drools 5: Properties properties = new Properties(); properties.setProperty( drools.dialect.java.compiler, RULE_COMPILER); PackageBuilderConfiguration conf = new PackageBuilderConfiguration(properties); saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Jon Gil Sent: Friday, February 25, 2011 11:15 AM To: Rules Users List Subject: Re: [rules-users] Object updated as rules are running How do we do that? Since we are using the rules server, all we are doing is calling with an HTTP call with the object and the rules flow we want to call. We then receive back the results as the HTTP response. 2011/2/25 Greg Barton greg_bar...@yahoo.com Did you notify the engine that your data has been updated? http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/h tml_single/index.html#d0e1436 See section 3.3.3.1.3 --- On Fri, 2/25/11, Jon Gil jonsprogrammingem...@gmail.com wrote: From: Jon Gil jonsprogrammingem...@gmail.com Subject: [rules-users] Object updated as rules are running To: rules-users@lists.jboss.org Date: Friday, February 25, 2011, 9:16 AM Hi, I have a very simple rules flow that I am getting odd results from. For now, our project is planning on using spreadsheets and a drools server. The test project we are working on accepts a movie name from an external source and creates a Movie object that is passed to the rules. The first rule looks at the movieName attribute and assigns it a movieStar using the Movie objects setMovieStar call. We have printLn statements before and after this action to confirm that it does in fact work. The second rule, where things go wrong, checks the MovieStar attribute, but no matter what we've just set it to, it always uses the value (NoStarYet) that was originally created when we create the Movie object in our Java code in the condition of our second rule. We've tried using the getMovieStar call in the condition, but it has been throwing errors when we startup the Drools Server. When we retreive the Movie object from the resultSet, the movieStar attribute is set correclty, but we can't get our flow to go as expected. This really seems like a simple issue, but we've had no luck with it. Any thoughts? Does the rules engine use the getter methods for conditions or does it use the values from the entityXML we pass in? Is there a way to make the engine update the object between running each rule? Any help is appreciated greatly. -Inline Attachment Follows- ___ rules-users mailing list rules-users@lists.jboss.org http://mc/compose?to=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] Eclipse IDE not validating .drl files
Hi there, If you are using drools 5, just change your drl file extensions to .dslr and make any change in a file and recompile. Hopefully it will help. saleem -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of StormeHawke Sent: Thursday, February 17, 2011 10:50 AM To: rules-users@lists.jboss.org Subject: [rules-users] Eclipse IDE not validating .drl files So it's been a while since I did any work with drools, so I don't know how long this problem has been here, but I recently started working on a new Drools project, using the latest Drools Eclipse IDE. Back on my previous Drools project, if I had a syntax error in my code it would give me compile errors in the IDE (I didn't have to wait until runtime). These syntax errors didn't always make sense, but they were generally helpful for finding misplaced semicolons and capitalization issues. The latest version of the Drools IDE does not seem to do this any more. Is this a deliberate change or is there something wrong with my configuration? -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Eclipse-IDE-not-vali dating-drl-files-tp2520025p2520025.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] dsl file in other folder
How can I access dsl file which is not in the same folder as the dslr; expander application.dsl {application.dsl is not in the same folder as dslr} thanks, saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] dsl file in other folder
I m using Drools 5 and I can see in an online book for Drools 5 that's using expander ... saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban Aliverti Sent: Thursday, February 17, 2011 12:42 PM To: Rules Users List Subject: Re: [rules-users] dsl file in other folder Which version of drools are you using? expander keyword is deprecated. There is no longer need to use it. Kbuilder will try to expand a dslr file with all the dsl definitions it has. Best regards, El feb 17, 2011 1:45 p.m., Saleem Lakhani saleem.lakh...@citizensfla.com escribió: How can I access dsl file which is not in the same folder as the dslr; expander application.dsl {application.dsl is not in the same folder as dslr} 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] dsl file in other folder
But the problem is that I have multiple versions of the dsl file with same name in different packages for example: com.dsl1 has application.dsl com.dsl2 has application.dsl ... more Now when I copy one of the dsl into the same folder as my dslr it works .. when I delete the dsl the dslr doesn't compile ... I just wana refer to the dsl and not copy it into the same folder. I understand the Kbuilder thing but I cant change it at this time; I have to use expander .. any help? saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: Thursday, February 17, 2011 1:28 PM To: Rules Users List Subject: Re: [rules-users] dsl file in other folder I have read and (I think) fully understood the 5.1.1. code of the DSL/DSLR parser, and the statement expander path just isn't used any more. Pass all your DSL files to the KnowledgeBuilder, and then all your DSLR files. -W 2011/2/17 Saleem Lakhani saleem.lakh...@citizensfla.com I m using Drools 5 and I can see in an online book for Drools 5 that's using expander ... saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban Aliverti Sent: Thursday, February 17, 2011 12:42 PM To: Rules Users List Subject: Re: [rules-users] dsl file in other folder Which version of drools are you using? expander keyword is deprecated. There is no longer need to use it. Kbuilder will try to expand a dslr file with all the dsl definitions it has. Best regards, El feb 17, 2011 1:45 p.m., Saleem Lakhani saleem.lakh...@citizensfla.com escribió: How can I access dsl file which is not in the same folder as the dslr; expander application.dsl {application.dsl is not in the same folder as dslr} 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] DSL file in other package/folder
Note: I am using eclipse IDE and when I change the rule and save it .. it needs to look at dsl to compile the rules, I am still in design phase so not using knowledge builder. the problem is that I have multiple versions of the dsl file with same name in different packages for example: com.dsl1 has application.dsl com.dsl2 has application.dsl ... more Now when I copy one of the dsl into the same folder as my dslr it works .. when I delete the dsl the dslr doesn't compile ... I just wana refer to the dsl and not copy it into the same folder. Thanks, saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun Sent: Thursday, February 17, 2011 1:28 PM To: Rules Users List Subject: Re: [rules-users] dsl file in other folder I have read and (I think) fully understood the 5.1.1. code of the DSL/DSLR parser, and the statement expander path just isn't used any more. Pass all your DSL files to the KnowledgeBuilder, and then all your DSLR files. -W 2011/2/17 Saleem Lakhani saleem.lakh...@citizensfla.com I m using Drools 5 and I can see in an online book for Drools 5 that's using expander ... saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban Aliverti Sent: Thursday, February 17, 2011 12:42 PM To: Rules Users List Subject: Re: [rules-users] dsl file in other folder Which version of drools are you using? expander keyword is deprecated. There is no longer need to use it. Kbuilder will try to expand a dslr file with all the dsl definitions it has. Best regards, El feb 17, 2011 1:45 p.m., Saleem Lakhani saleem.lakh...@citizensfla.com escribió: How can I access dsl file which is not in the same folder as the dslr; expander application.dsl {application.dsl is not in the same folder as dslr} 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Upgrading from Drools 2 to 5
Hi, I need some help regarding upgrading our validation engine from 2.0 to 5.0, I have added the required jars and my java code is compiling but the DRL and DSL are not. Any suggestions? Thanks, saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Upgrading from Drools 2 to 5
HI, Ok .. I did some tweaking and was able to get 1 simple rule to compile: I think I just need to go over the drl and do some manipulations like: 1. Changed .drl ifles to .dslr 2. Did some rule syntax changes like: [when]Coverage information exists=coverageTO : CoverageTO() à [condition][]Coverage exist= coverageTO : CoverageTO() How do I write something like this in drools 5: [when]myCondition=eval((coverageTO.getAmount()==null || coverageTO.getDeductible().length() =0) coverageTO.getOther().length()=0) Thanks for all the help; saleem From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Mauricio Salatino Sent: Friday, February 11, 2011 3:52 PM To: Rules Users List Subject: Re: [rules-users] Upgrading from Drools 2 to 5 What kind of errors are you getting? Can you share with us that information? 2011/2/11 Saleem Lakhani saleem.lakh...@citizensfla.com Hi, I need some help regarding upgrading our validation engine from 2.0 to 5.0, I have added the required jars and my java code is compiling but the DRL and DSL are not. Any suggestions? Thanks, saleem ___ 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
[rules-users] Simple question
Hi, I am having trouble with accessing two same objects with different data in working memory. When I print the list of working memory I see two objects: Com.model.PersonTO Com.model.PersonTO But I am not sure how to access each of them individually e.g; Person object exists = person: PersonTO() Please help. Saleem Lakhani ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] (no subject)
Hi, I need to have two objects of the same class present in the working memory at the same time. Both objects can have other nested objects of different classes. The reason is I need to compare data change b/w two objects. E.g; originalObject_A.getPersonTO().getAge() != changedObject_A.getPersonTO().getAge() I am using Drools 3.0, DRLs and DSL. My question is: how do I assert two objects belonging to the same class in working memory in order to access them both in DSL. E;g I can do: workingMemory.assertObject(originalObject_A); //instance of class A workingMemory.assertObject(changedObject_A); //instance of class A and in DRL I can write: [when]There is an instance with = originalObject_A:ClassA() how do I get the changedObject_A in dsl. How does drools know which object I am requesting? I hope my question is clear. Is it even possible in drools 3.0? Thanks Saleem Lakhani ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Comparing two object values
Hi, How do I compare attributes of two different objects. E.g; Object1.getEffectiveDate() Object2.getCompletionDate() In drools 3.0. I am using DSL. Thanks, Saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] String evaluation
Hi, Can we write something like this in Drools 3.0 ? [when]The Roof is not NA=Object(roof != ) where roof is some String object. Saleem Lakhani ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Minor Issue in writing DSL
Hi, If I had a rule written in DSL using Drools 3.0 like; 1. [when] when1=r : ObjectA( ) 2. [when] when2=eval(r.isApplication() || r.isBanker()) There are no attributes in class Object with name application and banker but there are methods in ObjectA with names isApplication() isBanker() which does some work and return Boolean based on some facts. What is the correct way of writing the same rule using Drools 4.0 ? Also, if the above attributes were present in ObjectA what would have been the best way to write it in DSL using Drools 4.0 Thanks, ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
RE: [rules-users] Minor Issue in writing DSL
When I use the syntax below and write like: [when]ABC=ObjectA(application==true || banker==true || officer==true) on drl it gives me the following error: Multiple markers at this line: -unknown:116:39 Unexpected token '==' -unknown:116:25 Unexpected token '||' -unknown:116:64 Unexpected token '==' Again, there are NO attributes in ObjectA named application, banker or officer. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli Sent: Tuesday, August 21, 2007 9:49 AM To: Rules Users List Subject: Re: [rules-users] Minor Issue in writing DSL Drools respects encapsulation, so it works with javabean method name conventions. If you have a method isApplication() that returns a boolean, does not matter how your class calculates the return value. Same for any other method. In 4.0, you can write: ObjectA( application == true || banker == true ) To map that as a DSL, just follow your usual procedure and syntax. []s Edson 2007/8/21, Saleem Lakhani [EMAIL PROTECTED]: Hi, If I had a rule written in DSL using Drools 3.0 like; 1. [when] when1=r : ObjectA( ) 2. [when] when2=eval(r.isApplication() || r.isBanker()) There are no attributes in class Object with name application and banker but there are methods in ObjectA with names isApplication() isBanker() which does some work and return Boolean based on some facts. What is the correct way of writing the same rule using Drools 4.0 ? Also, if the above attributes were present in ObjectA what would have been the best way to write it in DSL using Drools 4.0 Thanks, ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli Software Engineer - JBoss Rules Core Developer Office: +55 11 3529-6000 Mobile: +55 11 9287-5646 JBoss, a division of Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Unable to return Declaration for identifier
Thanks Edson. That helped alot. Can't we execute something simple like: ObjectA(units != families) When both units families are defined as int in ObjectA with their public get and set methods. This is the exception I am receiving. org.drools.rule.InvalidRulePackage: Unable to return Declaration for identifier 'families' : [Rule name=Rule6, agendaGroup=Rating, salience=0, no-loop=false] Its even showing correctly in drl editor. If I swap the positions of units families then the same exception is thrown for 'units'. regards, saleem ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Tutorial
Hi, I am wondering how someone gets start with writing DRLs DSLs without any tutorials or guidelines. If there is one then please share it with me. It is urgent. I am using Drools 4.0. Saleem Lakhani ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users