Re: [rules-users] facts comparison
Sure: $p1 : Person(...) $p2 : Person( this == $p1, ... ) this is a special self reference field. You can use any operator, obviously: ==, !=, memberOf, contains, etc, as appropriate. []s Edson 2007/8/28, hypnosat7 [EMAIL PROTECTED]: Hi, I need to compare 2 facts for example : $p1:Person(age==30) $p2:Person(age==40) $p1==$p2 can I do this comparison directly without usinfg the eval ? thanks -- View this message in context: http://www.nabble.com/facts-comparison-tf4341918.html#a12368537 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 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] Date comparasion does not work in 3.0.6?
can any one confirm this: i tested: 1.m : Message( date 2007-Mar-12, message : message ) 2. m : Message( date == 2007-Mar-12, message : message ) 3. m : Message( date 2007-Mar-12, message : message ) only 2 works. 1 and 3 throws: java.lang.RuntimeException: Operator '40' does not exist for StringEvaluator at org.drools.base.evaluators.StringFactory.getStringEvaluator(Unknown Source) at org.drools.base.EvaluatorFactory.getEvaluator(Unknown Source) at org.drools.base.EvaluatorFactory.getEvaluator(Unknown Source) at org.drools.semantics.java.RuleBuilder.getEvaluator(Unknown Source) at org.drools.semantics.java.RuleBuilder.build(Unknown Source) at org.drools.semantics.java.RuleBuilder.build(Unknown Source) at org.drools.semantics.java.RuleBuilder.build(Unknown Source) at org.drools.semantics.java.RuleBuilder.build(Unknown Source) at org.drools.compiler.PackageBuilder.addRule(Unknown Source) at org.drools.compiler.PackageBuilder.addPackage(Unknown Source) at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown Source) at com.sample.DroolsTest.readRule(DroolsTest.java:57) at com.sample.DroolsTest.main(DroolsTest.java:23) Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games. http://sims.yahoo.com/ ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] NPE on DecisionTable rule
Hey, gang! I have a decision table that generated the following rule: {other rules removed} #From row number: 19 rule postponePart_19 when PoolInfo(courtLocation == 101) PoolInfo(statusCode = 0, statusCode = 2) PoolInfo(numberFta 1) PoolInfo(numberOfDeferralsPosted 2) PoolInfo(daysBeforeSummons= 2, daysBeforeSummons= 999) then answer.setAnswer(true); end I call these rules with the following code (I build the ruleBase at the beginning in the factory method to be used by everything: StatelessSession session = participantRuleBase.newStatelessSession(); //now create some test data PoolInfo pool = part.getActivePool(); BooleanAnswer answer = new BooleanAnswer(); Object[] rules = new Object[]{pool, answer}; session.execute(rules); return answer.isTrue(); BooleanAnswer is simply a convenience object I created to store the answer from the rules. (If anyone has a better way to do this, please let me know.) I got the following stack trace: java.lang.NullPointerException at com.acs.gs.juror.bo.Rule_postponePart_19_0.consequence(Rule_postponePart_19_ 0.java:6) at com.acs.gs.juror.bo.Rule_postponePart_19_0ConsequenceInvoker.evaluate(Rule_p ostponePart_19_0ConsequenceInvoker.java:20) at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:545) at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:509) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.j ava:430) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.j ava:402) at org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java :128) I'm a newbie and have no idea what to do next. Please help. Thanks. Thom Hehl Sr. eJuror Architect * Office (859) 277-8800 x 144 * [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ACS, Inc. Government Solutions 1733 Harrodsburg Road Lexington, KY 40504-3617 This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message and notify sender via e-mail at [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] or by telephone at 859-277-8800 ext. 144. Thank you. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] DSL Troubles
Hi all, I'm using JBoss Rules 4.0.0.12865MR3 and trying to use a DSL expander in my DRL file: package docmap.logic import docmap.facts.* expander test_expander.dsl I didn't forget to also initialize the PackageBuilder: builder.addPackageFromDrl(sourceReader, dslReader) At runtime I always get the following exception, no matter which content the DSL file has: org.drools.rule.InvalidRulePackage: [EMAIL PROTECTED] many more ExpanderExceptions [EMAIL PROTECTED]@1bf3519 at org.drools.rule.Package.checkValidity(Package.java:409) Thanks in advance for any hint, Andreas ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] DSL Troubles
Andreas, Can you please try 4.0GA? http://labs.jboss.com/drools/downloads.html Thanks Edson 2007/8/28, Andreas Boehm [EMAIL PROTECTED]: Hi all, I'm using JBoss Rules 4.0.0.12865MR3 and trying to use a DSL expander in my DRL file: package docmap.logic import docmap.facts.* expander test_expander.dsl I didn't forget to also initialize the PackageBuilder: builder.addPackageFromDrl(sourceReader, dslReader) At runtime I always get the following exception, no matter which content the DSL file has: org.drools.rule.InvalidRulePackage: [EMAIL PROTECTED] many more ExpanderExceptions [EMAIL PROTECTED] @1bf3519 at org.drools.rule.Package.checkValidity(Package.java:409) Thanks in advance for any hint, Andreas ___ 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
Re: [rules-users] I can use RuleAgent without .properties file ???
you can use something like this. Properties p = new Properties(); p.setProperty(url, your url) ... RuleAgent aa = RuleAgent.newRuleAgent( p ) Fernando Meyer http://fmeyer.org [EMAIL PROTECTED] PGP: 0xD804DDFB On Aug 27, 2007, at 6:32 PM, Edgardo wrote: Hi list, I need your help, I need deploy the rules like Web Service, for this, I develop a web service method using the RuleAgent, but the Web Service can't read the .properties file. The question is: Exist any form for initialize RuleAgent without .properties file??? PD1: The problem could be the tomcat, but I am desperate PD2: Sorry for my poor English Thanks :D -- Edgardo Ibañez O. ___ 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] I can use RuleAgent without .properties file ???
Thanks Fernando, I have solved the problem See you in another thread :D En Tue, 28 Aug 2007 17:26:47 -0400, Fernando Meyer [EMAIL PROTECTED] escribió: you can use something like this. Properties p = new Properties(); p.setProperty(url, your url) ... RuleAgent aa = RuleAgent.newRuleAgent( p ) Fernando Meyer http://fmeyer.org [EMAIL PROTECTED] PGP: 0xD804DDFB On Aug 27, 2007, at 6:32 PM, Edgardo wrote: Hi list, I need your help, I need deploy the rules like Web Service, for this, I develop a web service method using the RuleAgent, but the Web Service can't read the .properties file. The question is: Exist any form for initialize RuleAgent without .properties file??? PD1: The problem could be the tomcat, but I am desperate PD2: Sorry for my poor English Thanks :D --Edgardo Ibañez O. ___ 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 -- Edgardo Ibañez O. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] DSL Troubles
Thanks Edson, I upgraded to 4.0.0GA but unfortunately this didn't do the trick. Greetings, Andreas On Tuesday 28 August 2007 23:23, Edson Tirelli wrote: http://labs.jboss.com/drools/downloads.html ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] DSL Troubles
May I ask you please to open a JIRA and attach a self contained test that shows your error? I will take a look. Thanks 2007/8/28, Andreas Boehm [EMAIL PROTECTED]: Thanks Edson, I upgraded to 4.0.0GA but unfortunately this didn't do the trick. Greetings, Andreas On Tuesday 28 August 2007 23:23, Edson Tirelli wrote: http://labs.jboss.com/drools/downloads.html ___ 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