Re: [rules-users] Guvnor Declarative Model
Exactly what I was thinking about, but I wanted to check first if I could reuse drools' bytecode generation instead of adding another thirdparty to the mix (one of my previous questions actually). I do want to avoid messing with custom classloaders as much as I can :-) From what I've seen, it doesn't seem to be easily reusable though Date: Mon, 10 Sep 2012 17:33:43 +0200 From: vincent.legen...@eurodecision.com To: rules-users@lists.jboss.org Subject: Re: [rules-users] Guvnor Declarative Model Ok, not simple indeed ... And why can't you generate a POJO instead of declarative fact ? De: Jean-Paul Shemali jshem...@hotmail.com À: rules-users@lists.jboss.org Envoyé: Lundi 10 Septembre 2012 10:06:43 Objet: Re: [rules-users] Guvnor Declarative Model Simply by not writing them in drools, but in another (proprietary) language, which in turn gets translated to drools at runtime. Of course there's nothing really simple about the translation and how the actual facts get generated Date: Sat, 8 Sep 2012 23:53:47 +0200 From: vincent.legen...@eurodecision.com To: rules-users@lists.jboss.org Subject: Re: [rules-users] Guvnor Declarative Model How can you declare your facts (or rules) if you don't know beforehand the structure of the POJO to use ? ___ 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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Guvnor Declarative Model
It may be faster to get the drools source code and change the generation by yourself. And post the new code to Edson ... - Mail original - De: Jean-Paul Shemali jshem...@hotmail.com À: rules-users@lists.jboss.org Envoyé: Mardi 11 Septembre 2012 08:29:08 Objet: Re: [rules-users] Guvnor Declarative Model Exactly what I was thinking about, but I wanted to check first if I could reuse drools' bytecode generation instead of adding another thirdparty to the mix (one of my previous questions actually). I do want to avoid messing with custom classloaders as much as I can :-) From what I've seen, it doesn't seem to be easily reusable though Date: Mon, 10 Sep 2012 17:33:43 +0200 From: vincent.legen...@eurodecision.com To: rules-users@lists.jboss.org Subject: Re: [rules-users] Guvnor Declarative Model Ok, not simple indeed ... And why can't you generate a POJO instead of declarative fact ? De: Jean-Paul Shemali jshem...@hotmail.com À: rules-users@lists.jboss.org Envoyé: Lundi 10 Septembre 2012 10:06:43 Objet: Re: [rules-users] Guvnor Declarative Model Simply by not writing them in drools, but in another (proprietary) language, which in turn gets translated to drools at runtime. Of course there's nothing really simple about the translation and how the actual facts get generated Date: Sat, 8 Sep 2012 23:53:47 +0200 From: vincent.legen...@eurodecision.com To: rules-users@lists.jboss.org Subject: Re: [rules-users] Guvnor Declarative Model How can you declare your facts (or rules) if you don't know beforehand the structure of the POJO to use ? ___ 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 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] ClasscastException in drools ant task
Hi All, I am trying to build a sample drools project using ant and getting the below error. I am using drools-distribution-5.4.0.Final release jars in my project. Unable to get this issue resolved as not sure what really went wrong. RuleBaseTask failed: Unable to load dialect 'org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel:org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration' at org.drools.contrib.DroolsCompilerAntTask.execute(DroolsCompilerAntTask.java:159) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java:1307) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:33) at org.apache.tools.ant.Project.executeTargets(Project.java:1191) at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423) at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137) Caused by: org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel:org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration' at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:313) at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:298) at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:187) at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:140) at org.drools.contrib.DroolsCompilerAntTask.getPackageBuilder(DroolsCompilerAntTask.java:556) at org.drools.contrib.DroolsCompilerAntTask.createWithPackageBuilder(DroolsCompilerAntTask.java:266) at org.drools.contrib.DroolsCompilerAntTask.execute(DroolsCompilerAntTask.java:156) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) at org.apache.tools.ant.Project.executeTargets(Project.java:1189) ... 2 more Caused by: java.lang.ClassCastException: org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:308) at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:298) at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:189) at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:142) at org.drools.contrib.DroolsCompilerAntTask.getPackageBuilder(DroolsCompilerAntTask.java:558) at org.drools.contrib.DroolsCompilerAntTask.createWithPackageBuilder(DroolsCompilerAntTask.java:266) at org.drools.contrib.DroolsCompilerAntTask.execute(DroolsCompilerAntTask.java:156) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[rules-users] problem when upgrading to 5.4.0.Final, got UnsupportedOperationException on an update call
Hi all, I am upgrading an application from 5.3.0.Final to 5.4.0.Final and I am getting the following exception: Exception executing consequence for rule ruleThatFails in indexingproblem.remove.me.anditworks: java.lang.UnsupportedOperationException at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39) at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287) at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1212) at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1446) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674) at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230) at com.mycompany.app.IndexingProblemMain.main(IndexingProblemMain.java:36) Caused by: java.lang.UnsupportedOperationException at org.drools.reteoo.BaseLeftTuple.getPrevious(BaseLeftTuple.java:480) at org.drools.core.util.index.LeftTupleList.remove(LeftTupleList.java:114) at org.drools.core.util.index.LeftTupleList.removeAdd(LeftTupleList.java:68) at org.drools.reteoo.JoinNode.modifyLeftTuple(JoinNode.java:310) at org.drools.reteoo.LeftTupleSource.doModifyLeftTuple(LeftTupleSource.java:304) at org.drools.reteoo.LeftTupleSource.modifyLeftTuple(LeftTupleSource.java:278) at org.drools.reteoo.JoinNode.modifyLeftTuple(JoinNode.java:437) at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateModifyLeftTuple(SingleLeftTupleSinkAdapter.java:205) at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateModifyObject(SingleLeftTupleSinkAdapter.java:235) at org.drools.reteoo.LeftInputAdapterNode.modifyObject(LeftInputAdapterNode.java:170) at org.drools.reteoo.SingleObjectSinkAdapter.propagateModifyObject(SingleObjectSinkAdapter.java:68) at org.drools.reteoo.AlphaNode.modifyObject(AlphaNode.java:157) at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:507) at org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:421) at org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:314) at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:265) at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:483) at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:383) at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:337) at indexingproblem.remove.me.anditworks.Rule_ruleThatFails_b159773c7b1a41a2a93044d2816b96ca.defaultConsequence(Rule_ruleThatFails_b159773c7b1a41a2a93044d2816b96ca.java:9) at indexingproblem.remove.me.anditworks.Rule_ruleThatFails_b159773c7b1a41a2a93044d2816b96caDefaultConsequenceInvokerGenerated.evaluate(Unknown Source) at indexingproblem.remove.me.anditworks.Rule_ruleThatFails_b159773c7b1a41a2a93044d2816b96caDefaultConsequenceInvoker.evaluate(Unknown Source) at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1277) ... 6 more I have tried to create a minimal test case that recreates this issue, here it is: package indexingproblem.remove.me.anditworks; declare Criteria processed : boolean end declare CheeseCriteria extends Criteria end rule setUp salience 1 when then insert(new CheeseCriteria()); end rule aaa when CheeseCriteria( ) then end rule bbb when CheeseCriteria( ) then end rule ccc when CheeseCriteria( ) then end rule eeeFalse when Criteria( processed == false ) then end declare Filter end rule fffTrue when Criteria( processed == true ) Filter( ) then end rule ruleThatFails when $criteria : Criteria( processed == false ) then modify($criteria) { setProcessed(true) } end I've tried to run it on 5.5.0-SNAPSHOT, but I got the same result. Note that if you change the rule package to be package indexingproblem the exception is not thrown. The code for building the KnowledgeBase is standard, I haven't used any additional options. No fact is inserted only one fireAllRules call. Please let me know if I should create a new JIRA ticket for this or if I am doing something wrong. Thanking you in advance. Best regards, Michal ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Cutom Attributes in Drools
Hi, Is there support for Custom Attributes in Drools? What I want to do is add attributes which determines when rules should be fired as well as attributes that the rule updates which I can query at a later time. E.g. Fire rule only for specific regions. So when new rules are created/added BAs can define if it is applicable to specific regions. Then the rule could result in a violation that could or could not be overriden, so I want to add an attribute called override which is set by the rule, which I can check after all rules are fired. I can use MetaData to define this, but I need a pre-defined list which BAs can choose from when creating a new rule. Any thoughts on how I can implement this would be appreciated. Thanks, dme -- View this message in context: http://drools.46999.n3.nabble.com/Cutom-Attributes-in-Drools-tp4019692.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] Adding .package files to a KnowledgePackage
So drools will respect files with a .package extension as a place for declared types, functions, etc. when used with these in the class path. How can a import these into a KnowledgePackage/KnowledgeBase so they can get compiled along with stuff when this is not in the class path at startup? My use case is such that these are not in the same space and can't be loaded at startup time in most cases. Any help is greatly appreciated, -- Paul Ryan ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users