[rules-users] java.util.NoSuchElementException in buildAsset
Hi, I have installed BRMS (Drools 5) and create a repository for BRMS. When I create a simple rule, like: when $object: Object() then System.out.println("ok"); end all works fine, but... When I create a complex rule, using my own complex classes and click in the validate button, the following error is reported : Error An error occurred executing the action. java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(StringTokenizer.java:332) at org.codehaus.janino.UnitCompiler.findClass(UnitCompiler.java) at org.codehaus.janino.Compiler$CompilerIClassLoader.findIClass(Compiler.java) at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java) at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.reclassify(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$114(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$15.visitAmbiguousName(UnitCompiler.java) at org.codehaus.janino.Java$AmbiguousName.accept(Java.java) at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$104(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$15.visitMethodInvocation(UnitCompiler.java) at org.codehaus.janino.Java$MethodInvocation.accept(Java.java) at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$51(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$9.visitMethodInvocation(UnitCompiler.java) at org.codehaus.janino.Java$MethodInvocation.accept(Java.java) at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$25(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$6.visitMethodInvocation(UnitCompiler.java) at org.codehaus.janino.Java$MethodInvocation.accept(Java.java) at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$8(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$4.visitExpressionStatement(UnitCompiler.java) at org.codehaus.janino.Java$ExpressionStatement.accept(Java.java) at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$7(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$4.visitBlock(UnitCompiler.java) at org.codehaus.janino.Java$Block.accept(Java.java) at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java) at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java) at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java) at org.codehaus.janino.Compiler.compile(Compiler.java) at org.drools.commons.jci.compilers.JaninoJavaCompiler.compile(JaninoJavaCompiler.java:174) at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51) at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:394) at org.drools.compiler.DialectRegistry.compileAll(DialectRegistry.java:60) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:324) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:168) at org.drools.brms.server.contenthandler.DRLFileContentHandler.compile(DRLFileContentHandler.java:32) at org.drools.brms.server.builder.ContentPackageAssembler.buildAsset(ContentPackageAssembler.java:139) at org.drools.brms.server.builder.ContentPackageAssembler.buildPackage(ContentPackageAssembler.java:127) at org.drools.brms.server.builder.ContentPackageAssembler.(ContentPackageAssembler.java:84) at org.drools.brms.server.builder.ContentPackageAssembler.(ContentPackageAssembler.java:92) at org.drools.brms.server.ServiceImplementation.buildPackage(ServiceImplementation.java:897) at org.drools.brms.server.ServiceImplementation.buildPackage(ServiceImplementation.java:887) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at s
RE: [rules-users] problems with desicion tables
Make sure all the xls files have the same package declaration at the top. Barry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vanina Beraudo Sent: Wednesday, July 23, 2008 3:27 PM To: rules-users@lists.jboss.org Subject: [rules-users] problems with desicion tables Hi, I am working with decition tables, I have differents xls files with rules and I want to add multiple xls files to the same rulebase and they will be merged into a single package. I do the following: private static RuleBase readTablaDecision() throws Exception { //read in the source final SpreadsheetCompiler converter = new SpreadsheetCompiler(); final String drl = converter.compile( "/reglaPrincipal.xls", InputType.XLS ); PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new StringReader( drl ) ); final String drl2, drl3; if((dj.getVersion()!=null)&&(dj.getVersion().compareTo("Version 1")==0)){ drl2 = converter.compile( "/reglaVersion1.xls", InputType.XLS ); builder.addPackageFromDrl( new StringReader( drl2 ) ); } Package pkg = builder.getPackage(); RuleBase ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); return ruleBase; } When I run the program, the following error message appear: org.drools.compiler.PackageBuilder$PackageMergeException: Can't merge packages with different names. This package: com.ReglaPrincipal - New package: com.reglaVersion1 at org.drools.compiler.PackageBuilder.validatePackageName(PackageBuilder.ja va:325) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:236) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java :167) Can I work with severals xls files? -- Lic. Vanina Beraudo ___ 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] problems with desicion tables
Hi, I am working with decition tables, I have differents xls files with rules and I want to add multiple xls files to the same rulebase and they will be merged into a single package. I do the following: private static RuleBase readTablaDecision() throws Exception { //read in the source final SpreadsheetCompiler converter = new SpreadsheetCompiler(); final String drl = converter.compile( "/reglaPrincipal.xls", InputType.XLS ); PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new StringReader( drl ) ); final String drl2, drl3; if((dj.getVersion()!=null)&&(dj.getVersion().compareTo("Version 1")==0)){ drl2 = converter.compile( "/reglaVersion1.xls", InputType.XLS ); builder.addPackageFromDrl( new StringReader( drl2 ) ); } Package pkg = builder.getPackage(); RuleBase ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); return ruleBase; } When I run the program, the following error message appear: org.drools.compiler.PackageBuilder$PackageMergeException: Can't merge packages with different names. This package: com.ReglaPrincipal - New package: com.reglaVersion1 at org.drools.compiler.PackageBuilder.validatePackageName(PackageBuilder.java:325) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:236) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167) Can I work with severals xls files? -- Lic. Vanina Beraudo ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] problems with decition tables
Hi, I am working with decition tables, I have differents xls files with rules and I want to add multiple xls files to the same rulebase and they will be merged into a single package. I do the following: private static RuleBase readTablaDecision() throws Exception { //read in the source final SpreadsheetCompiler converter = new SpreadsheetCompiler(); final String drl = converter.compile( "/reglaPrincipal.xls", InputType.XLS ); PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new StringReader( drl ) ); final String drl2, drl3; if((dj.getVersion()!=null)&&(dj.getVersion().compareTo("Version 1")==0)){ drl2 = converter.compile( "/reglaVersion1.xls", InputType.XLS ); builder.addPackageFromDrl( new StringReader( drl2 ) ); } Package pkg = builder.getPackage(); RuleBase ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); return ruleBase; } When I run the program, the following error message appear: org.drools.compiler.PackageBuilder$PackageMergeException: Can't merge packages with different names. This package: com.ReglaPrincipal - New package: com.reglaVersion1 at org.drools.compiler.PackageBuilder.validatePackageName(PackageBuilder.java:325) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:236) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167) Can I work with severals xls files? -- Lic. Vanina Beraudo ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] problems with decition tables
Hi, I am working with decition tables, I have differents xls files with rules and I want to add multiple xls files to the same rulebase and they will be merged into a single package. I do the following: private static RuleBase readTablaDecision() throws Exception { //read in the source final SpreadsheetCompiler converter = new SpreadsheetCompiler(); final String drl = converter.compile( "/reglaPrincipal.xls", InputType.XLS ); PackageBuilder builder = new PackageBuilder(); builder.addPackageFromDrl( new StringReader( drl ) ); final String drl2, drl3; if((dj.getVersion()!=null)&&(dj.getVersion().compareTo("Version 1")==0)){ drl2 = converter.compile( "/reglaVersion1.xls", InputType.XLS ); builder.addPackageFromDrl( new StringReader( drl2 ) ); } Package pkg = builder.getPackage(); RuleBase ruleBase = RuleBaseFactory.newRuleBase(); ruleBase.addPackage( pkg ); return ruleBase; } When I run the program, the following error message appear: org.drools.compiler.PackageBuilder$PackageMergeException: Can't merge packages with different names. This package: com.ReglaPrincipal - New package: com.reglaVersion1 at org.drools.compiler.PackageBuilder.validatePackageName(PackageBuilder.java:325) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:236) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167) Can I work with severals xls files? -- Lic. Vanina Beraudo ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] generic properties
Hi, you can try using "eval" when $io:InputObject() eval($io.getStringPropertyValue("propertyname")=="something") then .. 2008/7/23 thomas kukofka <[EMAIL PROTECTED]>: > Hello, > > I want to use a generic Input-Object for drools which can i.g. access String > properties: > > private HashMap stringParameter; > > with methods: > public String getStringPropertyValue(Parameter parameter) { > return stringParameter.get(parameter); > } > > public void setStringPropertyValue(Parameter parameter, String value) { > stringParameter.put(parameter, value); > } > > > My problem is can I use in drl something like : > > when > io: InputObject (getStringPropertyValue("propertyname") == "something") > > regards > thomas > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > > -- Lic. Vanina Beraudo ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] How to check for a variable number of "conditions" ina rule?
Ron, if your global is set before ***asserting facts to the working memory and not changed anymore, you can use it. Also, make sure your array or whatever is an attribute of a class, and so has some semantic to it. You can do things like this: when MyArrayContainer( $flags : flags ) Number( intValue >= SOME_GLOBAL_THRESHOLD ) from accumulate( $f : Flag( value == SOME_GLOBAL_VALUE ) from $flags, count( $f ) ) then // threshold met end Another options is just create a holder class for your globals and assert it as a fact instead of using globals: when MyParameters( $threshold : threshold, $value : value ) MyArrayContainer( $flags : flags ) Number( intValue >= $threshold ) from accumulate( $f : Flag( value == $flags ) from $flags, count( $f ) ) then // threshold met end Hope it helps, Edson 2008/7/23 Ron Kneusel <[EMAIL PROTECTED]>: > > Mike, > > I think the collect will work, I'll have to look at it more closely because > the ordering of elements in the array is significant so I'm not sure I can > just break the elements up into facts and let collect group them however it > will. > > As a follow up, while my solution of using a global in the LHS works, is > the problem with changing the global simply that the engine will not see the > changes? For my case, the global is set before the rules engine is called > and it will not change while the engine runs. > > Ron > > Mike wrote: > > >Have a look at the "Alarms" example for "Collect" in the (4.0.5) manual. > > > >This should give you a good starting point. > > > >Cheers, > > > >Mike > > _ > With Windows Live for mobile, your contacts travel with you. > > http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008 > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > -- Edson Tirelli JBoss Drools Core Development 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] generic properties
If you make your map available through a get, you can use simplified Map syntax like this: public Map getStringParameters() { return stringParameter; } io: InputObject ( stringParameters["propertyname"] == "something") []s Edson 2008/7/23 thomas kukofka <[EMAIL PROTECTED]>: > Hello , > > I just recognized, that this doesn't work. But it is possible to use plain > Java code in the rule, also if-conditions and for and while-loops etc.. > However more Java code makes the rule less readable and elegant. > Is there another possibility to use generic input objects? > > Thomas > > > > ___ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > > -- Edson Tirelli JBoss Drools Core Development 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] How to check for a variable number of "conditions" ina rule?
Mike, I think the collect will work, I'll have to look at it more closely because the ordering of elements in the array is significant so I'm not sure I can just break the elements up into facts and let collect group them however it will. As a follow up, while my solution of using a global in the LHS works, is the problem with changing the global simply that the engine will not see the changes? For my case, the global is set before the rules engine is called and it will not change while the engine runs. Ron Mike wrote: >Have a look at the "Alarms" example for "Collect" in the (4.0.5) manual. > >This should give you a good starting point. > >Cheers, > >Mike _ With Windows Live for mobile, your contacts travel with you. http://www.windowslive.com/mobile/overview.html?ocid=TXT_TAGLM_WL_mobile_072008 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] generic properties
Hello , I just recognized, that this doesn't work. But it is possible to use plain Java code in the rule, also if-conditions and for and while-loops etc.. However more Java code makes the rule less readable and elegant. Is there another possibility to use generic input objects? Thomas ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] InvalidClassException: When creating RuleAgent
The BRMS is using drools-core-4.0.7 and I was working with drools-core-4.0.4. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] generic properties
Hello, I want to use a generic Input-Object for drools which can i.g. access String properties: private HashMap stringParameter; with methods: public String getStringPropertyValue(Parameter parameter) { return stringParameter.get(parameter); } public void setStringPropertyValue(Parameter parameter, String value) { stringParameter.put(parameter, value); } My problem is can I use in drl something like : when io: InputObject (getStringPropertyValue("propertyname") == "something") regards thomas ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] InvalidClassException: When creating RuleAgent
When I create a new RuleAgent with a package created with the BRMS following Exception is thrown: RuleAgent(BusinessRuleEngine) INFO (Wed Jul 23 12:00:32 CEST 2008): Configuring with newInstance=true, secondsToRefresh=30 RuleAgent(BusinessRuleEngine) INFO (Wed Jul 23 12:00:32 CEST 2008): Configuring package provider : FileScanner scanning: D:\...\mypackage.pkg RuleAgent(BusinessRuleEngine) EXCEPTION (Wed Jul 23 12:00:33 CEST 2008): org.drools.base.mvel.DroolsMVELFactory; Serializable incompatible with Externalizable. Stack trace should follow. java.io.InvalidClassException: org.drools.base.mvel.DroolsMVELFactory; Serializable incompatible with Externalizable ... It works fine with another package created earlier. So it could be something wrong with my fact model. I couldn't find any useful information about the Serializeable incompatible with Externalizable on the web. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] What is the Maximum (rule)complexity in Drools
Hi , what is the maximum rule complexity in Drools 4.0.7 . are there any statistics regarding maximum rule complexity and load drools support ? regards , sekhar -- View this message in context: http://www.nabble.com/What-is-the-Maximum-%28rule%29complexity-in-Drools-tp18606115p18606115.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