[rules-users] rule compilation problems
Hi all, I am new to JBoss. I just finished making my first program with Rules and it works fine, but when I try to integrate all that into my web application (using Jetty), I get the following error: [java] java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems() [Lorg/eclipse/jdt/core/compiler/IProblem; [java] at org.apache.jasper.compiler.JDTCompiler$2.acceptResult(JDTCompiler.java:341) [java] at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:417) ... I tried to fix the problem with: conf = new PackageBuilderConfiguration(); conf.setCompiler(PackageBuilderConfiguration.JANINO); ... PackageBuilder builder = new PackageBuilder(conf); builder.addPackageFromDrl(new StringReader(rule.getText())); ruleBase.addPackage(builder.getPackage()); as in http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesTomcat but it's not working either. Same message. Can you help me? Thanks G. Arias del RIo ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] A Suggestion
Thanks for your suggestion Jagaran, i'm going to correct this issue. Fernando Meyer [EMAIL PROTECTED] GPG: 5A6D 3374 B055 A513 9A02 A03B 3DB3 7485 D804 DDFB On May 29, 2007, at 1:20 AM, jagaran das wrote: Hi I n BRMS when you upload a Fact model it takes any input you give. I mean let it be a simple file, a war file. But I think it gets reflected if you give only a jar file as input. So it would be nice if we have a check that we can upload only jar file and nothing else. Regards Jagaran Looking for people who are YOUR TYPE? Find them here! ___ 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] Re: JBRMS
Michael Neale michael.neale at gmail.com writes: Yes, as discussed, you need to add import statements for the types you want the BRMS to be aware of - if you like, create a feature request jira for auto importing. I deliberately didn't do it cause I thought it would cause more confusion, but perhaps I was wrong. Also, the video on the blog: http://markproctor.blogspot.com I made shows this.Michael. - The other question is: How could us contribute (If any interest on this, of course) , with the module? In particular we are looking for internationalization stuff. It is very important for us, and I think might be interesting for others users. Thanks Speaking of internationalization, I have a more specific question. I'd assume that using one Working memory for rules for one country would be advisable. Now, my business object model would be different also hence the Question: Q1) Can we have a base model that is shared across rules firing in multiple WM's and certain extended objects only loaded for certain WMemories??? I'm sorry I have not invested too much time studying the Drools 4 Class Loaders hierarchy so if you could just tell me the answer, I'd appreciate it. Will reasearch it later in detal. Q2) For that it would also imply when loading (DRL -- Package -- Rule Base -- W.M); Rule bases to Working memory we also have to worry about the object model. So, in the diagram for JBoss Rules 4 (http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesRepository) we only see a deployment strategy for the RuleBase and not its corresponsding Object Model; so that gives me a feeling that all object models are shared. Is this true? ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Removing Child Class Objects in dsl file level
My Code has the following Hierarchy. I am facing some problem, while I try to remove the Child level class object in .dsl file level. Class1: public class Class1{ private Class2 class2; //getter setters for class2 } Class2: public class Class2{ Private Class3 class3; //getter setters for class3 } Class3: public class Class3{ Object[] class4; //getter setters for class4 } Class4: public class Class4{ private String variable; //getter setters for variable } I will get only the object of Class1 in dsl level. When I try to remove the variable in Class4, I am facing some problem. I need to iterate the variable in Class4 and check weather all the values in the list of variable are same. workingMemory.assertObject(class1); // in test class I was not suppose to assert the object of Class2 or Class3 or Class4. [when]Some English Text = Class1(cl2 : class2) //in .dsl file [then]Log {message}=System.out.println({message}); //in .dsl file I tried the above code. But I can remove only the Class2 from Class1. I can’t remove the Class3 from Class2 Class4 from Class3 for futher iteration. Can some one help me on this issue? Thanks. -- View this message in context: http://www.nabble.com/Removing-Child-Class-Objects-in-dsl-file-level-tf3797470.html#a10741683 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] Agenda filter based on package name
It seems Rule class doesn't store its parent Package information and Rule.getPackage() always returns null. I would like to create an AgendaFilter based on package name but there is no way to get the parent package of each rule. Thanks, Hooman public class PackageNameAgendaFilter implements AgendaFilter { private final String packageSuffix; private final boolean accept; public PackageNameAgendaFilter(String packageSuffix){ this(packageSuffix, true); } public PackageNameAgendaFilter(String packageSuffix, boolean accept){ this.packageSuffix = packageSuffix; this.accept = accept; } public boolean accept(Activation activation) { if(activation.getRule().getPackage().startsWith(packageSuffix)) return accept; else return false; } } _ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vistamkt=en-USform=QBRE___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Extracting an boolean variable
I tried to extract a boolean variable from a class using context. The following is my code in DSL file. context : Context(state == START_UP) Classname(aliasname : booleanVariableName) When I tried to run this statement I got the following error message in DRL file. Error Message: Unable to Create Field Extractor for 'booleanVariableName'. But when I tried to extract a String Variable the Error is cleared. Can Someone explain me about this problem in Drools. Thanks. -- View this message in context: http://www.nabble.com/Extracting-an-boolean-variable-tf3827902.html#a10835911 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] JBoss Rules as a Daemon Service
Hi, I uploaded the JBoss Rules 4 WAR; I saw the repository options but no admin console to run a service. Maybe I'm missing something?!?! Q) Being under the cover of the JBoss server am sure there must be some fascility to run this as a daemon service 'out of the box'! Right?? -- Important (posted this 3 days ago but it got lost somwhere; prob deleted the approval mail; FYI not being impatient :o) but its important so would like to know) Thanks! ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Sudoku Example Errors
Hi Ming, I'm currently having a look at this - see my earlier post... as far as I can tell it might something to do with the setRemoveIdentities flag - but still cannot trace it through - but will keep you posted on my progress. Steve Ming Fang wrote: Hi, I'm getting many of these errors when running the Sudoku Example java.lang.NullPointerException at org.drools.reteoo.ReteTuple.get(ReteTuple.java:71) at org.drools.common.InstanceNotEqualsConstraint $InstanceNotEqualsConstraintContextEntry.updateFromTuple (InstanceNotEqualsConstraint.java:112) at org.drools.common.TripleBetaConstraints.updateFromTuple (TripleBetaConstraints.java:146) at org.drools.reteoo.NotNode.assertTuple(NotNode.java:108) at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple (SingleTupleSinkAdapter.java:29) at org.drools.reteoo.NotNode.assertTuple(NotNode.java:121) at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple (SingleTupleSinkAdapter.java:29) at org.drools.reteoo.NotNode.assertTuple(NotNode.java:121) at org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTupl e(CompositeTupleSinkAdapter.java:73) at org.drools.reteoo.LeftInputAdapterNode.assertObject (LeftInputAdapterNode.java:144) at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject (CompositeObjectSinkAdapter.java:317) at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java: 183) at org.drools.reteoo.Rete.assertObject(Rete.java:121) at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java: 201) at org.drools.reteoo.ReteooWorkingMemory.doAssertObject (ReteooWorkingMemory.java:70) at org.drools.common.AbstractWorkingMemory.assertObject (AbstractWorkingMemory.java:735) at org.drools.base.DefaultKnowledgeHelper.assertObject (DefaultKnowledgeHelper.java:72) at org.drools.base.DefaultKnowledgeHelper.assertObject (DefaultKnowledgeHelper.java:66) at org.drools.examples.sudoku.Rule_Rule_1__If_a_field_has_the_value_0__it_i s_empty__remove_it_and_insert_the_PossibleValues_0.consequence (Rule_Rule_1__If_a_field_has_the_value_0__it_is_empty__remove_it_and_ins ert_the_PossibleValues_0.java:8) at org.drools.examples.sudoku.Rule_Rule_1__If_a_field_has_the_value_0__it_i s_empty__remove_it_and_insert_the_PossibleValues_0ConsequenceInvoker.eva luate (Rule_Rule_1__If_a_field_has_the_value_0__it_is_empty__remove_it_and_ins ert_the_PossibleValues_0ConsequenceInvoker.java:22) at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java: 497) at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:461) at org.drools.common.AbstractWorkingMemory.fireAllRules (AbstractWorkingMemory.java:372) at org.drools.common.AbstractWorkingMemory.fireAllRules (AbstractWorkingMemory.java:353) at org.drools.examples.sudoku.SudokuExample.testWithInput (SudokuExample.java:52) at org.drools.examples.sudoku.SudokuExample.main(SudokuExample.java:94) Besides the fact that these errors are naturally bad, this points out the issue of Drools being very difficult debug when bad things happen. Can somebody give some tips of Drool debugging techniques? Thanks, --ming ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://www.nabble.com/Sudoku-Example-Errors-tf3814030.html#a10796945 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] Sudoku Example Errors
See my previous e-mail. Problem is fixed in trunk now. []s Edson 2007/5/25, webbo [EMAIL PROTECTED]: Hi Ming, I'm currently having a look at this - see my earlier post... as far as I can tell it might something to do with the setRemoveIdentities flag - but still cannot trace it through - but will keep you posted on my progress. Steve Ming Fang wrote: Hi, I'm getting many of these errors when running the Sudoku Example java.lang.NullPointerException at org.drools.reteoo.ReteTuple.get(ReteTuple.java:71) at org.drools.common.InstanceNotEqualsConstraint $InstanceNotEqualsConstraintContextEntry.updateFromTuple (InstanceNotEqualsConstraint.java:112) at org.drools.common.TripleBetaConstraints.updateFromTuple (TripleBetaConstraints.java:146) at org.drools.reteoo.NotNode.assertTuple(NotNode.java:108) at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple (SingleTupleSinkAdapter.java:29) at org.drools.reteoo.NotNode.assertTuple(NotNode.java:121) at org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple (SingleTupleSinkAdapter.java:29) at org.drools.reteoo.NotNode.assertTuple(NotNode.java:121) at org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTupl e(CompositeTupleSinkAdapter.java:73) at org.drools.reteoo.LeftInputAdapterNode.assertObject (LeftInputAdapterNode.java:144) at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject (CompositeObjectSinkAdapter.java:317) at org.drools.reteoo.ObjectTypeNode.assertObject( ObjectTypeNode.java: 183) at org.drools.reteoo.Rete.assertObject(Rete.java:121) at org.drools.reteoo.ReteooRuleBase.assertObject( ReteooRuleBase.java: 201) at org.drools.reteoo.ReteooWorkingMemory.doAssertObject (ReteooWorkingMemory.java:70) at org.drools.common.AbstractWorkingMemory.assertObject (AbstractWorkingMemory.java:735) at org.drools.base.DefaultKnowledgeHelper.assertObject (DefaultKnowledgeHelper.java:72) at org.drools.base.DefaultKnowledgeHelper.assertObject (DefaultKnowledgeHelper.java:66) at org.drools.examples.sudoku.Rule_Rule_1__If_a_field_has_the_value_0__it_i s_empty__remove_it_and_insert_the_PossibleValues_0.consequence (Rule_Rule_1__If_a_field_has_the_value_0__it_is_empty__remove_it_and_ins ert_the_PossibleValues_0.java:8) at org.drools.examples.sudoku.Rule_Rule_1__If_a_field_has_the_value_0__it_i s_empty__remove_it_and_insert_the_PossibleValues_0ConsequenceInvoker.eva luate (Rule_Rule_1__If_a_field_has_the_value_0__it_is_empty__remove_it_and_ins ert_the_PossibleValues_0ConsequenceInvoker.java:22) at org.drools.common.DefaultAgenda.fireActivation( DefaultAgenda.java: 497) at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java :461) at org.drools.common.AbstractWorkingMemory.fireAllRules (AbstractWorkingMemory.java:372) at org.drools.common.AbstractWorkingMemory.fireAllRules (AbstractWorkingMemory.java:353) at org.drools.examples.sudoku.SudokuExample.testWithInput (SudokuExample.java:52) at org.drools.examples.sudoku.SudokuExample.main( SudokuExample.java:94) Besides the fact that these errors are naturally bad, this points out the issue of Drools being very difficult debug when bad things happen. Can somebody give some tips of Drool debugging techniques? Thanks, --ming ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://www.nabble.com/Sudoku-Example-Errors-tf3814030.html#a10796945 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] Or and Collect
In my ongoing efforts to abuse Drools syntax, I would like to write rules like this: rule severe bugs for which a member of your group is dev or support owner when $group : UserGroup( ) $badBugs : List() from collect( Bug( (devOwner memberOf $group or supportOwner memberOf $group), severity == hair-on-fire ) then $group.runAroundInStarkRavingPanicOver($badBugs) end Will that work? Is that the right syntax? Will it be performant if I've got 1 Bugs and 1000 UserGroups? According to Mark's What's New in JBoss Rules 4.0 presentation, you can use and || without subrule generation, and I have a vague memory of seeing something about and or as well, but I can't remember where I saw it. Thanks. -- Dirk Bergstrom [EMAIL PROTECTED] _ Juniper Networks Inc., Computer Geek Tel: 408.745.3182 Fax: 408.745.8905 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Or and Collect
Hey Dirk, Trunk already supports || and without sub-rule generation. rule severe bugs for which a member of your group is dev or support owner when $group : UserGroup( ) $badBugs : List() from collect( Bug( (devOwner memberOf $group || supportOwner memberOf $group), severity == hair-on-fire ) then $group.runAroundInStarkRavingPanicOver($badBugs) end Just remember that collect is heavy. :) Other than that you are fine. And use || and for connecting constraints (no sub-rule generation) and and and or for connecting CE's. []s Edson 2007/5/29, Dirk Bergstrom [EMAIL PROTECTED]: In my ongoing efforts to abuse Drools syntax, I would like to write rules like this: rule severe bugs for which a member of your group is dev or support owner when $group : UserGroup( ) $badBugs : List() from collect( Bug( (devOwner memberOf $group or supportOwner memberOf $group), severity == hair-on-fire ) then $group.runAroundInStarkRavingPanicOver($badBugs) end Will that work? Is that the right syntax? Will it be performant if I've got 1 Bugs and 1000 UserGroups? According to Mark's What's New in JBoss Rules 4.0 presentation, you can use and || without subrule generation, and I have a vague memory of seeing something about and or as well, but I can't remember where I saw it. Thanks. -- Dirk Bergstrom [EMAIL PROTECTED] _ Juniper Networks Inc., Computer Geek Tel: 408.745.3182 Fax: 408.745.8905 ___ 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] Double
Why is it seeing it as a new object? I am asserting it into the working memory before hand. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor Sent: Wednesday, 30 May 2007 1:27 AM To: Rules Users List Subject: Re: [rules-users] Double highDutyTotal is a new fact inside of your consequence, so when you call modify, it's actually working as an assert - you are not doing a modify there at all. Mark Matthew Shaw wrote: Hi there, seeing some very strange behaviour from the following rule rule sum higher rate totals salience 970 no-loop true when timesheet : TimesheetTransferObject( ) total : SheetTotalTransferObject($ihrisType : ihrisType - ($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate - ($payRate.equals(timesheet.getOfficer().getSubstantiativeRate()) == false)) eval(total.getValue().doubleValue() 0) highDutyTotal : Double( ) then highDutyTotal = new Double(DateUtils.addElapsedTimes(highDutyTotal.doubleValue(), total.getValue().doubleValue())); modify(highDutyTotal) end In my test the rule fires twice when I don't call modify. Which is the expected behaviour because I have two unqiue SheetTotalTransferObject objects. However when I call modify on the Double object the rule only runs once. This is incorrect behaviour. Can anyone offer any clues as to what may be happening here. Is it to do with my use of the Double type? This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland.___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Double
It's standard java pass by reference stuff: String a = xxx; String b = a; System.out.println( b ); // gives xxx a = ; System.out.println( b ); // still gives xxx Mark Matthew Shaw wrote: Why is it seeing it as a new object? I am asserting it into the working memory before hand. *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Mark Proctor *Sent:* Wednesday, 30 May 2007 1:27 AM *To:* Rules Users List *Subject:* Re: [rules-users] Double highDutyTotal is a new fact inside of your consequence, so when you call modify, it's actually working as an assert - you are not doing a modify there at all. Mark Matthew Shaw wrote: Hi there, seeing some very strange behaviour from the following rule *rule* sum higher rate totals *salience* 970 *no-loop* *true* *when* timesheet : TimesheetTransferObject( ) total : SheetTotalTransferObject($ihrisType : ihrisType - ($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate - ($payRate.equals(timesheet.getOfficer().getSubstantiativeRate()) == *false*)) *eval*(total.getValue().doubleValue() 0) highDutyTotal : Double( ) *then* highDutyTotal = *new* Double(DateUtils.addElapsedTimes(highDutyTotal.doubleValue(), total.getValue().doubleValue())); modify(highDutyTotal) *end* In my test the rule fires twice when I don't call modify. Which is the expected behaviour because I have two unqiue SheetTotalTransferObject objects. However when I call modify on the Double object the rule only runs once. This is incorrect behaviour. Can anyone offer any clues as to what may be happening here. Is it to do with my use of the Double type? This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland. ___ 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] Double
ok point taken. I have modified my rule so that it looks at an object and I modify a property on that object instead as follows: But still the same issue. rule sum higher rate totals salience 970 no-loop true when timesheet : TimesheetTransferObject( ) total : SheetTotalTransferObject($ihrisType : ihrisType - ($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate - ($payRate.equals(timesheet.getOfficer().getSubstantiativeRate()) == false)) eval(total.getValue().doubleValue() 0) higherDutyTotal : DutyHourTotal( ) then higherDutyTotal.setNrHours(DateUtils.addElapsedTimes(higherDutyTotal.get NrHours(), total.getValue().doubleValue())); modify(higherDutyTotal); end From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor Sent: Wednesday, 30 May 2007 11:17 AM To: Rules Users List Subject: Re: [rules-users] Double It's standard java pass by reference stuff: String a = xxx; String b = a; System.out.println( b ); // gives xxx a = ; System.out.println( b ); // still gives xxx Mark Matthew Shaw wrote: Why is it seeing it as a new object? I am asserting it into the working memory before hand. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor Sent: Wednesday, 30 May 2007 1:27 AM To: Rules Users List Subject: Re: [rules-users] Double highDutyTotal is a new fact inside of your consequence, so when you call modify, it's actually working as an assert - you are not doing a modify there at all. Mark Matthew Shaw wrote: Hi there, seeing some very strange behaviour from the following rule rule sum higher rate totals salience 970 no-loop true when timesheet : TimesheetTransferObject( ) total : SheetTotalTransferObject($ihrisType : ihrisType - ($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate - ($payRate.equals(timesheet.getOfficer().getSubstantiativeRate()) == false)) eval(total.getValue().doubleValue() 0) highDutyTotal : Double( ) then highDutyTotal = new Double(DateUtils.addElapsedTimes(highDutyTotal.doubleValue(), total.getValue().doubleValue())); modify(highDutyTotal) end In my test the rule fires twice when I don't call modify. Which is the expected behaviour because I have two unqiue SheetTotalTransferObject objects. However when I call modify on the Double object the rule only runs once. This is incorrect behaviour. Can anyone offer any clues as to what may be happening here. Is it to do with my use of the Double type? This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive
Re: [rules-users] Double
Matthew Shaw's message received 5/29/2007 9:39 PM: ok point taken. I have modified my rule so that it looks at an object and I modify a property on that object instead as follows: But still the same issue. * * *rule* sum higher rate totals *salience* 970 *no-loop* *true* *when* timesheet : TimesheetTransferObject( ) total : SheetTotalTransferObject($ihrisType : ihrisType - ($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate - ($payRate.equals(timesheet.getOfficer().getSubstantiativeRate()) == *false*)) *eval*(total.getValue().doubleValue() 0) higherDutyTotal : DutyHourTotal( ) *then* higherDutyTotal.setNrHours(DateUtils.addElapsedTimes(higherDutyTotal.getNrHours(), total.getValue().doubleValue())); *modify*(higherDutyTotal); This modify call tells the rule engine to look at this DutyHourTotal object again. The rule should just keep firing. If there were some condition on the DutyHourTotal that eventually was false it would stop but I am surprised you only see it fire twice and not forever. Perhaps there are side effects of setNrHours() that cause one of the other conditions to fail. * end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Double
That's what modify does, it retracts the fact and then asserts it. Mark Matthew Shaw wrote: Hi Scott, My understanding is that the rule will only fire twice regardless because there are only two SheetTotal objects in working memory which is stopping the rule from going into infinite recursion. The no-loop attribute is also behaving correctly as it is not letting the engine add it back onto the Agenda. What is interesting however is that in this case the modify is behaving exactly as if I were to retract and then assert the DutyHourTotal object. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Reed Sent: Wednesday, 30 May 2007 11:48 AM To: Rules Users List Subject: Re: [rules-users] Double Matthew Shaw's message received 5/29/2007 9:39 PM: ok point taken. I have modified my rule so that it looks at an object and I modify a property on that object instead as follows: But still the same issue. * * *rule* sum higher rate totals *salience* 970 *no-loop* *true* *when* timesheet : TimesheetTransferObject( ) total : SheetTotalTransferObject($ihrisType : ihrisType - ($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate - ($payRate.equals(timesheet.getOfficer().getSubstantiativeRate()) == *false*)) *eval*(total.getValue().doubleValue() 0) higherDutyTotal : DutyHourTotal( ) *then* higherDutyTotal.setNrHours(DateUtils.addElapsedTimes(higherDutyTotal.g etNrHours(), total.getValue().doubleValue())); *modify*(higherDutyTotal); This modify call tells the rule engine to look at this DutyHourTotal object again. The rule should just keep firing. If there were some condition on the DutyHourTotal that eventually was false it would stop but I am surprised you only see it fire twice and not forever. Perhaps there are side effects of setNrHours() that cause one of the other conditions to fail. * end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users This correspondence is for the named persons only. It may contain confidential or privileged information or both. No confidentiality or privilege is waived or lost by any mis transmission. If you receive this correspondence in error please delete it from your system immediately and notify the sender. You must not disclose, copy or relay on any part of this correspondence, if you are not the intended recipient. Any opinions expressed in this message are those of the individual sender except where the sender expressly, and with the authority, states them to be the opinions of the Department of Emergency Services, Queensland. ___ 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] Re: JBRMS Query, very imp for me
Hi Mark, You are right I would try to use Hibernate to store data in MySql. But I have a different problem. For creating rule package through JBRMS I have done following stuffs: The project is really great. but i am unable to download the binary package. The steps followed by me is as below: 1. created a category. 2. created a package associated with that category. 3.Loaded a fact model which is a bean class and linked it with the package. 4. created some business rules. 5.imported the bean class in the configure package option and saved the changes. 6. created a new snapshot. 7. Build the package and it shown a success message too. 8. Now tried to download the package but it is giving package not found. Please let me know the solution. The message below is shown after i have created all the necessary stuffs. Building a package will collect all the assets, validate and compile into a deployable package. and the message that Package built successfully. But cant down load the package as it is giving the following menage. Status reportmessage /drools-jbrms/org.drools.brms.JBRMS/package/com.sample/LATEST description The requested resource (/drools-jbrms/org.drools.brms.JBRMS/package/com.sample/LATEST) is not available. Please let me know of the solutions. Mark Proctor [EMAIL PROTECTED] wrote:you lost me, sounds like you don't want to use jackrabbit persistence, but have your own way to store normalised rules in your own database schema - we don't have anything for that at the moment, you'd have to create this yourself. Mark jagaran das wrote: Hey Mark, Nice to receive your post. If we want to store data directly in the database we need some specific rule table and ruleset table and other tables and a persistence service like Hibernate. But we need to pick the values from the gui and arrange it accordingly. Regards JAGARAN - Download prohibited? No problem! CHAT from any browser, without download. - Did you know? You can CHAT without downloading messenger. Know how!___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Re: JBRMS Query, very imp for me
Howdy jagaran, Can you please give me some informations about your application environment? are you running on jboss AS, tomcat or jetty ? regards Fernando Fernando Meyer [EMAIL PROTECTED] GPG: 5A6D 3374 B055 A513 9A02 A03B 3DB3 7485 D804 DDFB On May 30, 2007, at 12:54 AM, jagaran das wrote: Hi Mark, You are right I would try to use Hibernate to store data in MySql. But I have a different problem. For creating rule package through JBRMS I have done following stuffs: The project is really great. but i am unable to download the binary package. The steps followed by me is as below: 1. created a category. 2. created a package associated with that category. 3.Loaded a fact model which is a bean class and linked it with the package. 4. created some business rules. 5.imported the bean class in the configure package option and saved the changes. 6. created a new snapshot. 7. Build the package and it shown a success message too. 8. Now tried to download the package but it is giving package not found. Please let me know the solution. The message below is shown after i have created all the necessary stuffs. Building a package will collect all the assets, validate and compile into a deployable package. and the message that Package built successfully. But cant down load the package as it is giving the following menage. Status report message /drools-jbrms/org.drools.brms.JBRMS/package/com.sample/LATEST description The requested resource (/drools-jbrms/ org.drools.brms.JBRMS/package/com.sample/LATEST) is not available. Please let me know of the solutions. Mark Proctor [EMAIL PROTECTED] wrote: you lost me, sounds like you don't want to use jackrabbit persistence, but have your own way to store normalised rules in your own database schema - we don't have anything for that at the moment, you'd have to create this yourself. Mark jagaran das wrote: Hey Mark, Nice to receive your post. If we want to store data directly in the database we need some specific rule table and ruleset table and other tables and a persistence service like Hibernate. But we need to pick the values from the gui and arrange it accordingly. Regards JAGARAN Download prohibited? No problem! CHAT from any browser, without download. Did you know? You can CHAT without downloading messenger. Know how! ___ 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] About Decision table
Hi to all, we wrote some rules as follows package com.leave import com.leave.paternity; rule Paternity Approved salience 1000 when paternity : paternity(gender == 'male',status =='married',role =='permanent',tenure = 2,year == 1,applied ==2); then paternity.eligible = 2; paternity.available = 2; System.out.println(leave approved for : + paternity.getname()); System.out.println(Total eligible leaves are : + paternity.getEligible()); end rule Paternity Approved1 salience 800 when paternity : paternity(gender == 'male',status =='married', role =='permanent(Onsite)',tenure = 2 , year ==1, applied ==2,withinmonth = 30); //withinmonth means if applied with in a month after returning from Onsite then paternity.eligible = 2; paternity.available = 2; System.out.println(leave approved for : + paternity.getname()); System.out.println(Total eligible leaves for employee Onsite are : + paternity.getEligible()); end And they are working fine in jboss 4.0 But we need help that in (from the above how can we write decision table for user (non developer that he wants to change the rulse) Pls give us some useful suggestions Regards: Kranthi Dalai ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] DSL to DRL File Conversion - Is it possible ?
Hi Mark , Can you just help me in converting this drl to dsl. ? How do i break lines in DSL involving OR conditions.? [when]- works for AND conditions . Do i really need give some english text (DSL mapping) for each line of the when condition when i use [when]- //Sample drl file. package com.fruit; import com.test.sample.*; rule FruitExample when C: Customer(); Fruit ( name == apple , costinrupees == 10) ; eval ( C.getNumOfCustomers() == 20 ( C.getCityname() == kanput || C.getCityname() == Disput )) then System.out.println(Rule Success); end The above conditions could be wrriten on a single line using eval() . But this looks pretty long. Are there any other options i coudl try for breaking line.? Do we have any workarounds for this.? Mark Proctor wrote: Its not straight forward but you can use the DRLDumper, one a PackageDescr, assuming it parses without errors: DrlParser parser = new DrlParser(); PackageDescr pkg = parser.parse( source, dsl ); final DrlDumper drlDumper = new DrlDumper(); final String drlResult = drlDumper.dump( pkg ); Michael Neale wrote: no in 3.0 version unfortunately. You can tell the parser to print out the DRL - but it will just write it out the System.out (only for debuggin). Look in RuleParser for that option. In trunk - which will be the new version - there is a seperate step which outputs DRL - but I don't think that made it into the M1 release - should be in M2 though. On 3/7/07, *kingston* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Is there anyway to get the DRL syntax out of the DSL format? Is there any Convenient API method Which takes rule in DSL format and the DSL File Name as arguments and returns the DRL Syntax ? -- View this message in context: http://www.nabble.com/DSL-to-DRL-File-Conversion---Is-it-possible---tf3360408.html#a9347582 Sent from the drools - user mailing list archive at Nabble.com http://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 ___ 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 :-/ -- View this message in context: http://www.nabble.com/DSL-to-DRL-File-Conversion---Is-it-possible---tf3360408.html#a10867626 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] Or and Collect
Edson Tirelli was heard to exclaim, On 05/29/07 17:13: $badBugs : List() from collect( Bug( (devOwner memberOf $group || supportOwner memberOf $group), severity == hair-on-fire ) And use || and for connecting constraints and and and or for connecting CE's. Ahh, ok. From the examples I'd seen, it was hard to tell, and the docs still show the two as equivalent for connecting CEs (section 3.15). This will allow me to replace an ugly predicate hack with a clunky but workable parenthetical grouping. Of course, if you'd care to implement yet another handy Collections-based constraint, I could make it really clean: We've got contains, and now memberOf (thanks for implementing my suggestion), so how about intersects? CheeseCounter( stinkyCheeses intersects crumblyCheeses ) Then I could write my rule like so: collect( Bug( (owners intersects $group), ... This would save me from having to edit ten or twenty rules when management inevitably decides that another kind of owner has to be included in the rules -- there are actually five owners now (which makes for a very ugly parenthetical). Can I file a jira for intersects, or should I quit being greedy, and enjoy the shiny new memberOf that I am in fact very happy about? :) -- Dirk Bergstrom [EMAIL PROTECTED] _ Juniper Networks Inc., Computer Geek Tel: 408.745.3182 Fax: 408.745.8905 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users