Re: [rules-users] Should we rename Drools Solver to Drools Planner?
+1 for me also 2009/11/21 Andrew Waterman andrew.water...@gmail.com +1 as well. On Nov 20, 2009, at 5:36 PM, Steve Núñez wrote: +1 On 21/11/09 12:33 AM, Geoffrey De Smet ge0ffrey.s...@gmail.com wrote: Hi guys, Should we rename Drools Solver to Drools Planner? http://blog.athico.com/2009/11/should-we-rename-drools-solver-to.html Your opinion is welcome on the blog. -- Level 40 140 William Street Melbourne, VIC 3000 Australia Phone: +61 3 9607 8287 Mobile: +61 4 0096 4240 Fax:+61 3 9607 8282 http://illation.com.au ___ 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] exception while adding a packageDescr to a PackageBuilder
I am trying to add a rule to a package. First I create a PackageDescr, then I create a RuleDescr and set some properties in it com.deepak.development.Trade class is loaded into the working memory before I try to create this rule Upon doing a DrlDump, I get the following (which is correctly formed; if I copy paste this in a drl file, the rule gets executed as expected) rule Added new Rule when trade : com.deepak.development.Trade( ) then System.out.println(Whatever);end // // CODE // //Create a PackageDescr //packages[0] is the package that is already available, //since I create a new PackageDescr with same name, //I expect the new rule to be appended to the existing package final PackageDescr packageDescr = new PackageDescr(new Package(packages[0].getName()).getName()); //Create a RuleDescr RuleDescr ruleDescr = new RuleDescr(Added new Rule); String consequence = System.out.println(\Whatever\);; AndDescr lhs = new AndDescr(); ruleDescr.setLhs( lhs ); final PatternDescr pattern = new PatternDescr( com.deepak.development.Trade.class.getName(),trade); lhs.addDescr( pattern ); ruleDescr.setConsequence( consequence ); PackageBuilder builder = new PackageBuilder(packages[0]); packageDescr.addRule( ruleDescr ); DrlDumper drlDumper = new DrlDumper(); System.out.println(Dumping Package Descriptor for all rules: + drlDumper.dump(packageDescr)); //Nullpointer Exception caught builder.addPackage(packageDescr); ruleBase.addPackage(builder.getPackage()); Doing a debug in eclipse I can see that a NullPointerException is caught in the line ###builder.addPackage(packageDescr)### Is there any other property I need to set in packageDescr before it can be added to a builder? I can see the following in the debug section of eclipse PackageStore.read(String) line: 58 The following is shown in the Variables side (in eclispe debug mode) [corresponds to PackageStore] thisPackageStore (id=13923) errors ArrayListE (id=15898) elementData Object[10] (id=19840) modCount0 size0 javaDialectRuntimeData null resourceNamejava/lang/Object.class (id=13925) count 22 hash0 offset 0 value(id=15896) clazz null -- View this message in context: http://old.nabble.com/exception-while-adding-a-packageDescr-to-a-PackageBuilder-tp26455685p26455685.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] exception while adding a packageDescr to a PackageBuilder
I can confirm that adding a PackageDescr to PackageBuilder works with drools-4.0.7 but throws a NullPointerException with Drools 5.0 Drools 5.1.0.M1 DeepakA wrote: I am trying to add a rule to a package. First I create a PackageDescr, then I create a RuleDescr and set some properties in it com.deepak.development.Trade class is loaded into the working memory before I try to create this rule Upon doing a DrlDump, I get the following (which is correctly formed; if I copy paste this in a drl file, the rule gets executed as expected) rule Added new Rule when trade : com.deepak.development.Trade( ) then System.out.println(Whatever);end // // CODE // //Create a PackageDescr //packages[0] is the package that is already available, //since I create a new PackageDescr with same name, //I expect the new rule to be appended to the existing package final PackageDescr packageDescr = new PackageDescr(new Package(packages[0].getName()).getName()); //Create a RuleDescr RuleDescr ruleDescr = new RuleDescr(Added new Rule); String consequence = System.out.println(\Whatever\);; AndDescr lhs = new AndDescr(); ruleDescr.setLhs( lhs ); final PatternDescr pattern = new PatternDescr( com.deepak.development.Trade.class.getName(),trade); lhs.addDescr( pattern ); ruleDescr.setConsequence( consequence ); PackageBuilder builder = new PackageBuilder(packages[0]); packageDescr.addRule( ruleDescr ); DrlDumper drlDumper = new DrlDumper(); System.out.println(Dumping Package Descriptor for all rules: + drlDumper.dump(packageDescr)); //Nullpointer Exception caught builder.addPackage(packageDescr); ruleBase.addPackage(builder.getPackage()); Doing a debug in eclipse I can see that a NullPointerException is caught in the line ###builder.addPackage(packageDescr)### Is there any other property I need to set in packageDescr before it can be added to a builder? I can see the following in the debug section of eclipse PackageStore.read(String) line: 58 The following is shown in the Variables side (in eclispe debug mode) [corresponds to PackageStore] this PackageStore (id=13923) errors ArrayListE (id=15898) elementData Object[10] (id=19840) modCount0 size0 javaDialectRuntimeData null resourceName java/lang/Object.class (id=13925) count 22 hash0 offset 0 value(id=15896) clazz null -- View this message in context: http://old.nabble.com/exception-while-adding-a-packageDescr-to-a-PackageBuilder-tp26455685p26456520.html Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] exception while adding a packageDescr to a PackageBuilder
It works in Drools 5.0 after setting a value for Namespace in PackageDescr DeepakA wrote: I can confirm that adding a PackageDescr to PackageBuilder works with drools-4.0.7 but throws a NullPointerException with Drools 5.0 Drools 5.1.0.M1 DeepakA wrote: I am trying to add a rule to a package. First I create a PackageDescr, then I create a RuleDescr and set some properties in it com.deepak.development.Trade class is loaded into the working memory before I try to create this rule Upon doing a DrlDump, I get the following (which is correctly formed; if I copy paste this in a drl file, the rule gets executed as expected) rule Added new Rule when trade : com.deepak.development.Trade( ) then System.out.println(Whatever);end // // CODE // //Create a PackageDescr //packages[0] is the package that is already available, //since I create a new PackageDescr with same name, //I expect the new rule to be appended to the existing package final PackageDescr packageDescr = new PackageDescr(new Package(packages[0].getName()).getName()); //Create a RuleDescr RuleDescr ruleDescr = new RuleDescr(Added new Rule); String consequence = System.out.println(\Whatever\);; AndDescr lhs = new AndDescr(); ruleDescr.setLhs( lhs ); final PatternDescr pattern = new PatternDescr( com.deepak.development.Trade.class.getName(),trade); lhs.addDescr( pattern ); ruleDescr.setConsequence( consequence ); PackageBuilder builder = new PackageBuilder(packages[0]); packageDescr.addRule( ruleDescr ); DrlDumper drlDumper = new DrlDumper(); System.out.println(Dumping Package Descriptor for all rules: + drlDumper.dump(packageDescr)); //Nullpointer Exception caught builder.addPackage(packageDescr); ruleBase.addPackage(builder.getPackage()); Doing a debug in eclipse I can see that a NullPointerException is caught in the line ###builder.addPackage(packageDescr)### Is there any other property I need to set in packageDescr before it can be added to a builder? I can see the following in the debug section of eclipse PackageStore.read(String) line: 58 The following is shown in the Variables side (in eclispe debug mode) [corresponds to PackageStore] this PackageStore (id=13923) errors ArrayListE (id=15898) elementData Object[10] (id=19840) modCount0 size0 javaDialectRuntimeData null resourceName java/lang/Object.class (id=13925) count 22 hash0 offset 0 value(id=15896) clazznull -- View this message in context: http://old.nabble.com/exception-while-adding-a-packageDescr-to-a-PackageBuilder-tp26455685p26458012.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