Re: [rules-users] Get fact type returning null
A class edu.arizona.result is not to be seen (at least for me), and that's why getFactType() returns null. Does it work when you create a KnowlegeBase from DRL? Is Resource changeset != null? -W On 17/01/2012, kavita wrote: > Hi, > > I am a beginner to drools and am trying to integrate drools rules to java . > Am doing this using changeset. > Here's my piece of code: > > package edu.arizona; > > import org.drools.KnowledgeBase; > > import org.drools.agent.KnowledgeAgent; > import org.drools.agent.KnowledgeAgentFactory; > > import org.drools.definition.type.FactType; > import org.drools.io.Resource; > import org.drools.io.ResourceFactory; > import org.drools.runtime.StatefulKnowledgeSession; > > public class TestRest { >public static void main(String[] args) throws > InstantiationException,IllegalAccessException { >StatefulKnowledgeSession ksession = null; > KnowledgeBase kbase = readKnowledgeBase(); > > FactType factType = kbase.getFactType("edu.arizona", > "result"); > System.out.println (factType); > Object obj = factType.newInstance(); > > factType.set(obj,"rawConcentration",150); > > > ksession = kbase.newStatefulKnowledgeSession(); > ksession.insert(obj); > > ksession.fireAllRules(); > > System.out.println(factType.get(obj,"rescode")); > >} >private static KnowledgeBase readKnowledgeBase() { > KnowledgeAgent kagent = > KnowledgeAgentFactory.newKnowledgeAgent("LabAgent"); > Resource changeset = ResourceFactory.newClassPathResource( > "edu.arizona/lab-changeset.xml"); > kagent.applyChangeSet(changeset); > KnowledgeBase kbase = kagent.getKnowledgeBase(); > > kagent.dispose(); > return kbase; > } > } > > > When i run the application the System.out.println (factType) is printing as > null. and getting > > Exception in thread "main" java.lang.NullPointerException > at edu.arizona.TestRest.main(TestRest.java:20) > > What am i missing? Please help. > > Thanks, > Kavitha. > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/Get-fact-type-returning-null-tp3667266p3667266.html > Sent from the Drools: User forum 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
Re: [rules-users] How to combine different drl files
On 18/01/2012, Zhao Yi wrote: > I have a bunch of drl files and they are in same package. How can I combine > these drl files to one big drl files? Why do you want to do that? You can compile and integrate them into a Knowledge Base easily. > I am looking for a drools API to > generate the big drl file automatically? There is no such thing. -W > > -- > View this message in context: > http://drools.46999.n3.nabble.com/How-to-combine-different-drl-files-tp3668184p3668184.html > Sent from the Drools: User forum 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
Re: [rules-users] Guvnor export options.
Take a look at the documentation: REST-API and webdav sections. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Wed, Jan 18, 2012 at 5:03 AM, pm-lemos wrote: > Hi, > > I'm kind of looking for a way to export the rules I wrote in Guvnor to a > .DRL file. > Is it possible? How can I do it? > > Thanks in advance. > Pedro > > -- > View this message in context: > http://drools.46999.n3.nabble.com/Guvnor-export-options-tp3668262p3668262.html > Sent from the Drools: User forum 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] java.lang.ArrayIndexOutOfBoundsException at Frame
Hi Drools Users, I'm new member, Mujoko. I got issue regarding my rules. Several times got exception when trying to create KnowledgeSession. I used drools-core 5.3.0.Final and drools-compiler 5.3.0.Final. java.lang.ArrayIndexOutOfBoundsException: -1 at org.mvel2.asm.Frame.merge(Frame.java:1373) at org.mvel2.asm.Frame.merge(Frame.java:1350) at org.mvel2.asm.MethodWriter.visitMaxs(MethodWriter.java:1282) at org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:480) at org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:50) at org.drools.rule.builder.dialect.asm.ASMEvalBuilder.createEvalBytecode(ASMEvalBuilder.java:63) at org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:49) at org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:15) at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65) at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:80) at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2289) at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:822) -- Mujoko http://www.linkedin.com/in/mujoko ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] java.lang.ArrayIndexOutOfBoundsException at Frame
You're going to give a little more information, such as the DRL you're unable to compile. 2012/1/18 mujoko mujoko > Hi Drools Users, > > I'm new member, Mujoko. > I got issue regarding my rules. Several times got exception when trying to > create KnowledgeSession. I used drools-core 5.3.0.Final and > drools-compiler 5.3.0.Final. > > java.lang.ArrayIndexOutOfBoundsException: -1 >at org.mvel2.asm.Frame.merge(Frame.java:1373) >at org.mvel2.asm.Frame.merge(Frame.java:1350) >at org.mvel2.asm.MethodWriter.visitMaxs(MethodWriter.java:1282) >at > > org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:480) >at > > org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:50) >at > > org.drools.rule.builder.dialect.asm.ASMEvalBuilder.createEvalBytecode(ASMEvalBuilder.java:63) >at > > org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:49) >at > > org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:15) >at > > org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65) >at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:80) >at > org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2289) >at > org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:822) > > > > -- > Mujoko > http://www.linkedin.com/in/mujoko > > > ___ > 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] java.lang.ArrayIndexOutOfBoundsException at Frame
For your info, for the same rules. It's not always happen, the error some times coming. For me the rule is fine (I used guvnor) Here is the rule import com.rbtsb.tm.meter.model.CDR; import org.apache.log4j.Logger; global Logger log; rule "ProductTag-FixedSMS" when $cdr : CDR(callClassCode == "F1" || callClassCode == "F2" ) then $cdr.setProductName("fixedsms"); end 2012/1/18 Michael Anstis > You're going to give a little more information, such as the DRL you're > unable to compile. > > 2012/1/18 mujoko mujoko > >> Hi Drools Users, >> >> I'm new member, Mujoko. >> I got issue regarding my rules. Several times got exception when trying to >> create KnowledgeSession. I used drools-core 5.3.0.Final and >> drools-compiler 5.3.0.Final. >> >> java.lang.ArrayIndexOutOfBoundsException: -1 >>at org.mvel2.asm.Frame.merge(Frame.java:1373) >>at org.mvel2.asm.Frame.merge(Frame.java:1350) >>at org.mvel2.asm.MethodWriter.visitMaxs(MethodWriter.java:1282) >>at >> >> org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:480) >>at >> >> org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:50) >>at >> >> org.drools.rule.builder.dialect.asm.ASMEvalBuilder.createEvalBytecode(ASMEvalBuilder.java:63) >>at >> >> org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:49) >>at >> >> org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:15) >>at >> >> org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65) >>at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:80) >>at >> org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2289) >>at >> org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:822) >> >> >> >> -- >> Mujoko >> http://www.linkedin.com/in/mujoko >> >> >> ___ >> 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 > > -- Mujoko http://www.linkedin.com/in/mujoko ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Audit log created with Drools 5.1 unreadable with Drools 5.3 Eclipse plugin?
To people sharing the same issue, installing the 5.4.0.Beta1 version of Drools eclipse plugin resolves the problem. -- View this message in context: http://drools.46999.n3.nabble.com/Audit-log-created-with-Drools-5-1-unreadable-with-Drools-5-3-Eclipse-plugin-tp3490197p3668897.html Sent from the Drools: User forum 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] ClassCastException when KnowledgeAgent loads declared type
In which order do you load the DRLs? Since resources are loaded one at a time, the DRL with the declarations should be added to the knowledgebase first. -- View this message in context: http://drools.46999.n3.nabble.com/ClassCastException-when-KnowledgeAgent-loads-declared-type-tp3664044p3668912.html Sent from the Drools: User forum 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] java.lang.ArrayIndexOutOfBoundsException at Frame
Please show field and getter declarations in class CDR -W On 18/01/2012, mujoko mujoko wrote: > For your info, for the same rules. It's not always happen, the error some > times coming. > For me the rule is fine (I used guvnor) > Here is the rule > > import com.rbtsb.tm.meter.model.CDR; > import org.apache.log4j.Logger; > > global Logger log; > > rule "ProductTag-FixedSMS" > > when > $cdr : CDR(callClassCode == "F1" || callClassCode == "F2" ) > then > $cdr.setProductName("fixedsms"); > end > > > > 2012/1/18 Michael Anstis > >> You're going to give a little more information, such as the DRL you're >> unable to compile. >> >> 2012/1/18 mujoko mujoko >> >>> Hi Drools Users, >>> >>> I'm new member, Mujoko. >>> I got issue regarding my rules. Several times got exception when trying >>> to >>> create KnowledgeSession. I used drools-core 5.3.0.Final and >>> drools-compiler 5.3.0.Final. >>> >>> java.lang.ArrayIndexOutOfBoundsException: -1 >>>at org.mvel2.asm.Frame.merge(Frame.java:1373) >>>at org.mvel2.asm.Frame.merge(Frame.java:1350) >>>at org.mvel2.asm.MethodWriter.visitMaxs(MethodWriter.java:1282) >>>at >>> >>> org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:480) >>>at >>> >>> org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:50) >>>at >>> >>> org.drools.rule.builder.dialect.asm.ASMEvalBuilder.createEvalBytecode(ASMEvalBuilder.java:63) >>>at >>> >>> org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:49) >>>at >>> >>> org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:15) >>>at >>> >>> org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65) >>>at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:80) >>>at >>> org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2289) >>>at >>> org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:822) >>> >>> >>> >>> -- >>> Mujoko >>> http://www.linkedin.com/in/mujoko >>> >>> >>> ___ >>> 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 >> >> > > > -- > Mujoko > http://www.linkedin.com/in/mujoko > ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Drools Guvnor 5.1 in WAS 6.1 server
Hi all, I'm new to Drools and facing some difficulties to run Guvnor in websphere 6.1 server. I'm not finding any specific doc or guideline that i can follow to deploy Guvnor 5.1 in WAS 6.1 server. Can you please guide me step by step to deploy guvnor in WAS. It's very urgent and I need to do it as soon as possible. please help. Thanks in advance... -- View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-5-1-in-WAS-6-1-server-tp3669083p3669083.html Sent from the Drools: User forum 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] Drools Guvnor 5.1 in WAS 6.1 server
This is a bit out-of-date, not sure if it helps: https://community.jboss.org/wiki/DroolsGuvnor50Installation Cheers, Jervis On 2012/1/18 20:32, arup wrote: > Hi all, > I'm new to Drools and facing some difficulties to run Guvnor in websphere > 6.1 server. I'm not finding any specific doc or guideline that i can follow > to deploy Guvnor 5.1 in WAS 6.1 server. Can you please guide me step by step > to deploy guvnor in WAS. It's very urgent and I need to do it as soon as > possible. please help. Thanks in advance... > > -- > View this message in context: > http://drools.46999.n3.nabble.com/Drools-Guvnor-5-1-in-WAS-6-1-server-tp3669083p3669083.html > Sent from the Drools: User forum 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] unable to load jar file
Hi, I am trying to upload a POJO jar file into drools guvnor. But it is throwing me an error saying "unable to load file". This is the file that am trying to upload http://drools.46999.n3.nabble.com/file/n3669841/QcResult.jar QcResult.jar I am running drools guvnor 5.3 on tomcat server. When i looked into the logs of tomcat, the following is the stacktrace.. SEVERE: Servlet.service() for servlet AssetFileServlet threw exception java.lang.ClassNotFoundException: groovy.lang.GroovyObject at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86) at org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104) at java.lang.ClassLoader.loadClass(Unknown Source) at org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183) at org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148) at org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66) at org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115) at org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) at org.drools.guvnor.server.files.FileManagerUtils_$$_javassist_seam_10.attachFile(FileManagerUtils_$$_javassist_seam_10.java) at org.drools.guvnor.server.files.AssetFileServlet.processAttachFileToAsset(AssetFileServlet.java:97) at org.drools.guvnor.server.files.AssetFileServlet.doPost(AssetFileServlet.java:49) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42) at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:65) at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.val
Re: [rules-users] unable to load jar file
Seems like your model has some Groovy dependencies. If you upload a jar, all the referenced classes (dependencies) of that jar must to be available to Guvnor. What I recommend to do is to create a plain POJO model without any external library dependency (if possible) Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Wed, Jan 18, 2012 at 6:10 PM, kavita wrote: > Hi, > > I am trying to upload a POJO jar file into drools guvnor. But it is > throwing > me an error saying "unable to load file". > This is the file that am trying to upload > > http://drools.46999.n3.nabble.com/file/n3669841/QcResult.jar QcResult.jar > > I am running drools guvnor 5.3 on tomcat server. When i looked into the > logs > of tomcat, the following is the stacktrace.. > > SEVERE: Servlet.service() for servlet AssetFileServlet threw exception > java.lang.ClassNotFoundException: groovy.lang.GroovyObject >at > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) >at > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) >at java.lang.Class.forName0(Native Method) >at java.lang.Class.forName(Unknown Source) >at > > org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109) >at java.lang.ClassLoader.loadClass(Unknown Source) >at java.lang.ClassLoader.defineClass1(Native Method) >at java.lang.ClassLoader.defineClassCond(Unknown Source) >at java.lang.ClassLoader.defineClass(Unknown Source) >at > > org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86) >at > > org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104) >at java.lang.ClassLoader.loadClass(Unknown Source) >at > > org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183) >at > > org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148) >at > > org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66) >at > > org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115) >at > > org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87) >at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >at java.lang.reflect.Method.invoke(Unknown Source) >at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) >at > > org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) >at > > org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) >at > > org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) >at > > org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >at > > org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) >at > > org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >at > > org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) >at > > org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >at > > org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163) >at > > org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >at > org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) >at > > org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) >at > > org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) >at > > org.drools.guvnor.server.files.FileManagerUtils_$$_javassist_seam_10.attachFile(FileManagerUtils_$$_javassist_seam_10.java) >at > > org.drools.guvnor.server.files.AssetFileServlet.processAttachFileToAsset(AssetFileServlet.java:97) >at > > org.drools.guvnor.server.files.AssetFileServlet.doPost(AssetFileServlet.java:49) >at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) >at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) >at > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) >at > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) >at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42) >at > > org.jboss.seam.servlet.ContextualHttpSer
Re: [rules-users] unable to load jar file
Hi, Can anybody tell me how to use groovy classes as fact classes in guvnor. Because, i tried to upload the jar file of the java classes and it seems to be working fine. Thanks, Kavitha. On Wed, Jan 18, 2012 at 10:13 AM, Esteban Aliverti < esteban.alive...@gmail.com> wrote: > Seems like your model has some Groovy dependencies. If you upload a jar, > all the referenced classes (dependencies) of that jar must to be available > to Guvnor. > What I recommend to do is to create a plain POJO model without any > external library dependency (if possible) > > Best Regards, > > > > Esteban Aliverti > - Developer @ http://www.plugtree.com > - Blog @ http://ilesteban.wordpress.com > > > > On Wed, Jan 18, 2012 at 6:10 PM, kavita wrote: > >> Hi, >> >> I am trying to upload a POJO jar file into drools guvnor. But it is >> throwing >> me an error saying "unable to load file". >> This is the file that am trying to upload >> >> http://drools.46999.n3.nabble.com/file/n3669841/QcResult.jar QcResult.jar >> >> I am running drools guvnor 5.3 on tomcat server. When i looked into the >> logs >> of tomcat, the following is the stacktrace.. >> >> SEVERE: Servlet.service() for servlet AssetFileServlet threw exception >> java.lang.ClassNotFoundException: groovy.lang.GroovyObject >>at >> >> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) >>at >> >> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) >>at java.lang.Class.forName0(Native Method) >>at java.lang.Class.forName(Unknown Source) >>at >> >> org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109) >>at java.lang.ClassLoader.loadClass(Unknown Source) >>at java.lang.ClassLoader.defineClass1(Native Method) >>at java.lang.ClassLoader.defineClassCond(Unknown Source) >>at java.lang.ClassLoader.defineClass(Unknown Source) >>at >> >> org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86) >>at >> >> org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104) >>at java.lang.ClassLoader.loadClass(Unknown Source) >>at >> >> org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183) >>at >> >> org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148) >>at >> >> org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66) >>at >> >> org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115) >>at >> >> org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87) >>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >>at java.lang.reflect.Method.invoke(Unknown Source) >>at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) >>at >> >> org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) >>at >> >> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) >>at >> >> org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) >>at >> >> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >>at >> >> org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) >>at >> >> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >>at >> >> org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) >>at >> >> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >>at >> >> org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163) >>at >> >> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >>at >> org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) >>at >> >> org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) >>at >> >> org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) >>at >> >> org.drools.guvnor.server.files.FileManagerUtils_$$_javassist_seam_10.attachFile(FileManagerUtils_$$_javassist_seam_10.java) >>at >> >> org.drools.guvnor.server.files.AssetFileServlet.processAttachFileToAsset(AssetFileServlet.java:97) >>at >> >> org.drools.guvnor.server.files.AssetFileServlet.doPost(AssetFileServlet.java:49) >>at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) >>at
Re: [rules-users] unable to load jar file
As far as I know, what you are asking is not possible. Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2012/1/18 kavitha sethu > Hi, > > Can anybody tell me how to use groovy classes as fact classes in guvnor. > Because, i tried to upload the jar file of the java classes and it seems to > be working fine. > > Thanks, > Kavitha. > > > > On Wed, Jan 18, 2012 at 10:13 AM, Esteban Aliverti < > esteban.alive...@gmail.com> wrote: > >> Seems like your model has some Groovy dependencies. If you upload a jar, >> all the referenced classes (dependencies) of that jar must to be available >> to Guvnor. >> What I recommend to do is to create a plain POJO model without any >> external library dependency (if possible) >> >> Best Regards, >> >> >> >> Esteban Aliverti >> - Developer @ http://www.plugtree.com >> - Blog @ http://ilesteban.wordpress.com >> >> >> >> On Wed, Jan 18, 2012 at 6:10 PM, kavita wrote: >> >>> Hi, >>> >>> I am trying to upload a POJO jar file into drools guvnor. But it is >>> throwing >>> me an error saying "unable to load file". >>> This is the file that am trying to upload >>> >>> http://drools.46999.n3.nabble.com/file/n3669841/QcResult.jarQcResult.jar >>> >>> I am running drools guvnor 5.3 on tomcat server. When i looked into the >>> logs >>> of tomcat, the following is the stacktrace.. >>> >>> SEVERE: Servlet.service() for servlet AssetFileServlet threw exception >>> java.lang.ClassNotFoundException: groovy.lang.GroovyObject >>>at >>> >>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) >>>at >>> >>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) >>>at java.lang.Class.forName0(Native Method) >>>at java.lang.Class.forName(Unknown Source) >>>at >>> >>> org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109) >>>at java.lang.ClassLoader.loadClass(Unknown Source) >>>at java.lang.ClassLoader.defineClass1(Native Method) >>>at java.lang.ClassLoader.defineClassCond(Unknown Source) >>>at java.lang.ClassLoader.defineClass(Unknown Source) >>>at >>> >>> org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86) >>>at >>> >>> org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104) >>>at java.lang.ClassLoader.loadClass(Unknown Source) >>>at >>> >>> org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183) >>>at >>> >>> org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148) >>>at >>> >>> org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66) >>>at >>> >>> org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115) >>>at >>> >>> org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87) >>>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >>>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >>>at java.lang.reflect.Method.invoke(Unknown Source) >>>at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) >>>at >>> >>> org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) >>>at >>> >>> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) >>>at >>> >>> org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) >>>at >>> >>> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >>>at >>> >>> org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) >>>at >>> >>> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >>>at >>> >>> org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) >>>at >>> >>> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >>>at >>> >>> org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163) >>>at >>> >>> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) >>>at >>> org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) >>>at >>> >>> org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) >>>at >>> >>> org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) >>>at >>> >>> org.drools.guvnor.server.files.FileManagerUtils_$$_jav
[rules-users] Groovy classes as fact classes in drool
Hi, Can anybody tell me how to use groovy classes as fact classes in drools. When i try to upload the jar file generated from the groovy class am getting the following error: SEVERE: Servlet.service() for servlet AssetFileServlet threw exception java.lang.ClassNotFoundException: groovy.lang.GroovyObject at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86) at org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104) at java.lang.ClassLoader.loadClass(Unknown Source) at org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183) at org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148) at org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66) at org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115) at org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) at org.drools.guvnor.server.files.FileManagerUtils_$$_javassist_seam_10.attachFile(FileManagerUtils_$$_javassist_seam_10.java) at org.drools.guvnor.server.files.AssetFileServlet.processAttachFileToAsset(AssetFileServlet.java:97) at org.drools.guvnor.server.files.AssetFileServlet.doPost(AssetFileServlet.java:49) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42) at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:65) at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.Co
[rules-users] Why isn't my rule firing??
First, my intent: 1) insert a pojo into a stateful session 2) based upon that pojo's attributes, create and insert a new fact (different type) 3) retract the initial pojo, but keep the newly created fact in memory for some period of time After some helpful insight from the forum, I thought I could knock this out. However, I'm stuck and I've boiled down to what I imagine is a misunderstanding that I have. I have the code and rules below. With each fact that I insert, I expected 1) to see the number of facts grow (the list of facts printed line 16 does grow with each call). This works 2) to see the NotificationEvent added only once to working memory (the facts printed shows only one NotificationEvent and then a new MyBean for each one I insert). So, I think this works also. 3) BUT, each time I call fireAllRules(), I expect the "foundNE" rule to be triggered and to see "Found A notification event" printed. However, this is only printed once - after my first insert. Also, I see that 0 rules get fired (line 13) after the first MyBean insert. SO, if I see a NotificationEvent in the list of facts in line 17, why isn't my foundNE rule printing out the message each time I insert a new MyBean and call fireallrules?? FYI, my future plan is to have a rule with low salience that retracts the MyBeans just inserted and have my foundNE rule retract any NotificationEvents that are at least 10 mins old. (so that the NotificationEvents will grow but not MyBeans) . Here is my test code (please excuse typos - there are none in my code): Thanks very much for any insight. -J ===test.java === 1 KnowledgeBase kbase = readKnowledgeBaseFromFile(); 2 StatefulKnowledegeSession ksession = kbase.newStatefulKnowledgeSession(): 3 KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession,"testlog"); 4 for (int x=0;x<10;x++){ 5 myBean mb = new MyBean(); 6 mb.setName("me"); 7 mb.setHeadline("my_head"); 8 mb.setTag("tagline"); 9 10 List cmds = new ArrayList(); 11 FactHandle fh = (FactHandle) ksession.insert(seb); 12 int rf = ksession.fireAllRules(); 13 System.out.println(rf+"rules fired"); 14 15 Collection c = ksession.getFactHandles(); 16 for (FactHandle f:c) { 17 System.out.println(" now: "+f.toString()); 18 } 19 20 Thread.sleep(5000); 21 } === test.drl import com.me.MyBean import java.util.Calendar declare NotificationEvent name: String headline: String tagline: String dts: Long end rule "foundNE" dialect "mvel" when $ne : NotificationEvent() then System.out.println("Found a Notification Event"); end rule "NotTemplate_1" dialect "mvel" when $myb : MyBean(name matches "me", headline matches "my_head") not ($ne : NotificationEvent(name matches $myb.name, headline=$myb.headline) then NotificationEvent fact0 = new NotificationEvent(); fact0.setName($myb.name); fact0.setHeadline($myb.headline); insert(fact0); System.out.println("Adding a notification event"); end -- View this message in context: http://drools.46999.n3.nabble.com/Why-isn-t-my-rule-firing-tp3670261p3670261.html Sent from the Drools: User forum 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] Why isn't my rule firing??
Ok, still working on this, but I have more information from http://drools.46999.n3.nabble.com/fireAllRules-multiply-times-td1019111.html#a1019469 and http://drools.46999.n3.nabble.com/How-to-avoid-multiple-calls-to-fireAllRules-if-possible-td50345.html#a50349 apparently fireallrules() doesn't actually fire all rules...the second time. this noob is unclear why, but i'm looking into a way to update an fact handle. (One challenge I left out of my initial description is that eventually I'll be connecting to a session on a drools server - so that further limits my options) -- View this message in context: http://drools.46999.n3.nabble.com/Why-isn-t-my-rule-firing-tp3670261p3670556.html Sent from the Drools: User forum 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] Why isn't my rule firing??
This is by design. Unless you modify an object and inform the inference engine of the change, rule conditions will not be re-evaluated. If you want the rule to re-fire you must tell the engine to reconsider the old NotificationEvents via update() or modify(). A rule like this would do it every time a new MyBean is detected: rule "TouchAllNotificationEvents" dialect "mvel" when MyBean() $ne : NotificationEvent() then update($ne); end --- On Wed, 1/18/12, dunnlow wrote: > From: dunnlow > Subject: [rules-users] Why isn't my rule firing?? > To: rules-users@lists.jboss.org > Date: Wednesday, January 18, 2012, 1:47 PM > First, my intent: > > 1) insert a pojo into a stateful session > 2) based upon that pojo's attributes, create and > insert a new fact > (different type) > 3) retract the initial pojo, but keep the newly > created fact in memory for > some period of time > > After some helpful insight from the forum, I thought I > could knock this out. > > However, I'm stuck and I've boiled down to what I imagine > is a > misunderstanding that I have. I have the code and > rules below. > > With each fact that I insert, I expected > 1) to see the number of facts grow (the list of > facts printed line 16 does > grow with each call). This works > 2) to see the NotificationEvent added only once to > working memory (the > facts printed shows only one NotificationEvent and then a > new MyBean for > each one I insert). So, I think this works also. > 3) BUT, each time I call fireAllRules(), I expect > the "foundNE" rule to be > triggered and to see "Found A notification event" > printed. However, this is > only printed once - after my first insert. Also, I see that > 0 rules get > fired (line 13) after the first MyBean insert. > > SO, if I see a NotificationEvent in the list of facts in > line 17, why isn't > my foundNE rule printing out the message each time I insert > a new MyBean and > call fireallrules?? > > FYI, my future plan is to have a rule with low salience > that retracts the > MyBeans just inserted and have my foundNE rule retract any > NotificationEvents that are at least 10 mins old. (so > that the > NotificationEvents will grow but not MyBeans) . > > Here is my test code (please excuse typos - there are none > in my code): > > Thanks very much for any insight. > -J > > ===test.java === > > 1 KnowledgeBase kbase = readKnowledgeBaseFromFile(); > 2 StatefulKnowledegeSession ksession = > kbase.newStatefulKnowledgeSession(): > 3 KnowledgeRuntimeLogger logger = > KnowledgeRuntimeLoggerFactory.newFileLogger(ksession,"testlog"); > > 4 for (int x=0;x<10;x++){ > 5 myBean mb = new MyBean(); > 6 mb.setName("me"); > 7 mb.setHeadline("my_head"); > 8 mb.setTag("tagline"); > 9 > 10 List cmds = new > ArrayList(); > 11 FactHandle fh = (FactHandle) > ksession.insert(seb); > 12 int rf = ksession.fireAllRules(); > 13 System.out.println(rf+"rules fired"); > 14 > 15 Collection c = > ksession.getFactHandles(); > 16 for (FactHandle f:c) { > 17 > System.out.println(" now: "+f.toString()); > 18 } > 19 > 20 Thread.sleep(5000); > 21 } > > === test.drl > import com.me.MyBean > import java.util.Calendar > > declare NotificationEvent > name: String > headline: String > tagline: String > dts: Long > end > > rule "foundNE" > dialect "mvel" > when > $ne : > NotificationEvent() > then > > System.out.println("Found a Notification Event"); > end > > rule "NotTemplate_1" > dialect "mvel" > when > $myb : MyBean(name > matches "me", headline matches "my_head") > not ($ne : > NotificationEvent(name matches $myb.name, > headline=$myb.headline) > then > NotificationEvent > fact0 = new NotificationEvent(); > > fact0.setName($myb.name); > > fact0.setHeadline($myb.headline); > insert(fact0); > > System.out.println("Adding a notification event"); > end > > -- > View this message in context: > http://drools.46999.n3.nabble.com/Why-isn-t-my-rule-firing-tp3670261p3670261.html > Sent from the Drools: User forum 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
Re: [rules-users] ClassCastException when KnowledgeAgent loads declared type
I was able to create a working unit test for the workaround of moving the declared type out of the rules file and into a different package; but when I deployed this change on my server, the files loaded ok the first time, but again I ran into trouble when I would redeploy the base rules file. This time I got an error when the knowledge agent tried to load the package: WARN 2012-01-18 14:15:03,416 [com.abclegal.rules.server.RulesServiceImpl] - KnowledgeAgent has KnowledgeBuilder errors object=Unable to resolve ObjectType 'TransgressionMetaData' : [Rule name='Remedy Transgressions '] Which looks like another symptom of the same bug. I will see if I can test for the bug with 5.4 when I get a chance. -- View this message in context: http://drools.46999.n3.nabble.com/ClassCastException-when-KnowledgeAgent-loads-declared-type-tp3664044p3670779.html Sent from the Drools: User forum 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] How to combine different drl files
I have about 100 drl files. If I load them in knowledge base, it will be very slow. So I want to combine them into one big drl file then compile it. laune wrote > > On 18/01/2012, Zhao Yiwrote: >> I have a bunch of drl files and they are in same package. How can I >> combine >> these drl files to one big drl files? > > Why do you want to do that? You can compile and integrate them into a > Knowledge Base easily. > >> I am looking for a drools API to >> generate the big drl file automatically? > > There is no such thing. > -W > >> >> -- >> View this message in context: >> http://drools.46999.n3.nabble.com/How-to-combine-different-drl-files-tp3668184p3668184.html >> Sent from the Drools: User forum mailing list archive at Nabble.com. >> ___ >> rules-users mailing list >> rules-users@.jboss >> https://lists.jboss.org/mailman/listinfo/rules-users >> > ___ > rules-users mailing list > rules-users@.jboss > https://lists.jboss.org/mailman/listinfo/rules-users > -- View this message in context: http://drools.46999.n3.nabble.com/How-to-combine-different-drl-files-tp3668184p3671319.html Sent from the Drools: User forum 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] Drools Guvnor 5.1 in WAS 6.1 server
Thanks a lot Jervis Liu. I followed the link provided by u. But one of the link(to adjust the Guvnor settings) is not working. please provide me some info about this. I need to complete this task by 2day. anyone having experiance in installing Guvnor in WAS 6.1 please help. Thanks in advance -- View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-5-1-in-WAS-6-1-server-tp3669083p3671520.html Sent from the Drools: User forum 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] java.lang.ClassCastException: java.lang.String cannot be cast to com.sample.DroolsTest$Message
Hi All, Can anybody tell me what is the problem here .. i have a 2 classes: person(i have a field in this :java.lang.String add) Message(i have a filed in this :java.lang.String name) rule "H" when person( $a : add ) Message ( name == "tree" ) from $a then # System.out.println("in H rule"); when i compile this rule i am getting below exception... java.lang.ClassCastException: java.lang.String cannot be cast to com.sample.DroolsTest$Message Thanks in Advance Veeras -- View this message in context: http://drools.46999.n3.nabble.com/java-lang-ClassCastException-java-lang-String-cannot-be-cast-to-com-sample-DroolsTest-Message-tp3671568p3671568.html Sent from the Drools: User forum 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] Drools Guvnor 5.1 in WAS 6.1 server
Hi, I'm not able to open this link to adjust guvnor settings. https://zuxho14:9045/ibm/help/index.jsp?topic=/com.ibm.ws.console.appmanagement/urun_rapp_classload.html Looks like the site is not available now. Please share some alternative link. or if u have the informations shared in this link please share it. -- View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-5-1-in-WAS-6-1-server-tp3669083p3671587.html Sent from the Drools: User forum 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] java.lang.ClassCastException: java.lang.String cannot be cast to com.sample.DroolsTest$Message
Try this.. $p : person( ) Message( name == "tree" ) from $p.add -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Veera Sent: Thursday, January 19, 2012 11:57 AM To: rules-users@lists.jboss.org Subject: [rules-users] java.lang.ClassCastException: java.lang.String cannot be cast to com.sample.DroolsTest$Message Hi All, Can anybody tell me what is the problem here .. i have a 2 classes: person(i have a field in this :java.lang.String add) Message(i have a filed in this :java.lang.String name) rule "H" when person( $a : add ) Message ( name == "tree" ) from $a then # System.out.println("in H rule"); when i compile this rule i am getting below exception... java.lang.ClassCastException: java.lang.String cannot be cast to com.sample.DroolsTest$Message Thanks in Advance Veeras -- View this message in context: http://drools.46999.n3.nabble.com/java-lang-ClassCastException-java-lang-String-cannot-be-cast-to-com-sample-DroolsTest-Message-tp3671568p3671568.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] How to combine drl files to one binary file
I have some drl rule files in different packages. How can I combine them into one binary file? Thanks, Zhao Yi -- View this message in context: http://drools.46999.n3.nabble.com/How-to-combine-drl-files-to-one-binary-file-tp3671606p3671606.html Sent from the Drools: User forum 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] How to combine different drl files
You realize that you can compile once and load the serialized Knowledge Base repeatedly, which results in the fastest possible startup. Combining DRL files will be faster but not as fast as using a serialized KB. -W On 19/01/2012, Zhao Yi wrote: > I have about 100 drl files. If I load them in knowledge base, it will be > very > slow. So I want to combine them into one big drl file then compile it. > > > laune wrote >> >> On 18/01/2012, Zhao Yiwrote: >>> I have a bunch of drl files and they are in same package. How can I >>> combine >>> these drl files to one big drl files? >> >> Why do you want to do that? You can compile and integrate them into a >> Knowledge Base easily. >> >>> I am looking for a drools API to >>> generate the big drl file automatically? >> >> There is no such thing. >> -W >> >>> >>> -- >>> View this message in context: >>> http://drools.46999.n3.nabble.com/How-to-combine-different-drl-files-tp3668184p3668184.html >>> Sent from the Drools: User forum mailing list archive at Nabble.com. >>> ___ >>> rules-users mailing list >>> rules-users@.jboss >>> https://lists.jboss.org/mailman/listinfo/rules-users >>> >> ___ >> rules-users mailing list >> rules-users@.jboss >> https://lists.jboss.org/mailman/listinfo/rules-users >> > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/How-to-combine-different-drl-files-tp3668184p3671319.html > Sent from the Drools: User forum 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
Re: [rules-users] How to combine drl files to one binary file
You pass all the DRL files to the Knowledge Builder, one after the other. Then you obtain the Knowledge Packages. Either you serialize them, or the Knowledge Base builot with them. This is described in the Expert manual. -W On 19/01/2012, Zhao Yi wrote: > I have some drl rule files in different packages. How can I combine them > into > one binary file? > > Thanks, > Zhao Yi > > -- > View this message in context: > http://drools.46999.n3.nabble.com/How-to-combine-drl-files-to-one-binary-file-tp3671606p3671606.html > Sent from the Drools: User forum 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
Re: [rules-users] java.lang.ClassCastException: java.lang.String cannot be cast to com.sample.DroolsTest$Message
You cannot cast an object of type java.lang.String (i.e. $a as it is bound to "add") to Message. Apparently you have not understood how "from" works. (Its various forms are described in the "Expert" manual.) Most frequently, it is used to "pull" one or more objects, one at a time, from a fact, in order to permit them to match a pattern although they have not been inserted in Working Memory. What I see in this rule doesn't indicate what you might have intended to do - so I cannot propose an improved version. -W On 19/01/2012, Veera wrote: > Hi All, > > Can anybody tell me what is the problem here .. > i have a 2 classes: > person(i have a field in this :java.lang.String > add) > Message(i have a filed in this :java.lang.String > name) > rule "H" > when > person( $a : add ) > Message ( name == "tree" ) from $a > > then > # System.out.println("in H rule"); > > when i compile this rule i am getting below exception... > > java.lang.ClassCastException: java.lang.String cannot be cast to > com.sample.DroolsTest$Message > > Thanks in Advance > Veeras > > > > -- > View this message in context: > http://drools.46999.n3.nabble.com/java-lang-ClassCastException-java-lang-String-cannot-be-cast-to-com-sample-DroolsTest-Message-tp3671568p3671568.html > Sent from the Drools: User forum 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