Re: [rules-users] Loop Drools on Multi Element
Using forall isn't so complicated. You can use the simplified form, where the condition to be satisfied is written in the pattern selecting the domain. rule setPriority when $order: OrderType( priority != high ) forall ( OrderLineType( quantity 2 ) from $order.lineItem ) then modify( $order ){ setPriority( high ) } System.out.println( set to high ); end This illustrates very nicely the duality (by de Morgan's laws) between forall and negated existence. As for efficiency: repeated evaluation of large lists where the elements aren't facts /may/ slow you down - whether this is a problem depends on other factors. -- View this message in context: http://drools.46999.n3.nabble.com/Loop-Drools-on-Multi-Element-tp3761638p3765879.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] Problem while running the project
Hi all, when i deployed my EAR in the websphere application server it's deployed successfully without any errors. But when i'm trying to run my project by passing a request xml i'm getting some errors as shown below. I'm using drools 5.1 and WAS 6.1. java.lang.UnsupportedClassVersionError: (com/ibm/xmlns/prod/websphere/wcc/common/intf/schema/Control) bad major version at offset=6 ServletWrappe E Deregister the mbean because of uncaught init() exception thrown by servlet spring-ws: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception thrown by servlet here is the full console view: [2/22/12 14:10:58:616 IST] 0022 WebAppA SRVE0180I: [GPMServicesEAR#GPMServices.war] [/GPMServices] [Servlet.LOG]: Initializing Spring FrameworkServlet 'spring-ws' [2/22/12 14:10:58:616 IST] 0022 MessageDispat I org.springframework.web.servlet.FrameworkServlet initServletBean FrameworkServlet 'spring-ws': initialization started [2/22/12 14:10:58:666 IST] 0022 XmlWebApplica I org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing WebApplicationContext for namespace 'spring-ws-servlet': startup date [Wed Feb 22 14:10:58 IST 2012]; root of context hierarchy [2/22/12 14:10:58:746 IST] 0022 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-ws-servlet.xml] [2/22/12 14:10:59:562 IST] 0022 XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/beans-def/gpm-services.xml] [2/22/12 14:11:00:066 IST] 0022 AnnotationAct I org.springframework.ws.soap.addressing.server.AbstractAddressingEndpointMapping afterPropertiesSet Supporting [WS-Addressing August 2004, WS-Addressing 1.0] [2/22/12 14:11:00:136 IST] 0022 DefaultListab I org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@44344434: defining beans [adapterUtil,addPartyContextAdapterToMdm,addressAdapterToMDM,alertsAdapterToMDM,compositePartyInquiryAdapterToMDM,createSuspectsAdapterToMDM,emailAdapterToMDM,getPartyContextAdapterToMdm,getPartyRelationsAdapterToMdm,govtIdInfoAdapterToMDM,oLifeAdapterToMDM,organizationAdapterToMDM,organizationSearchAdapterToMDM,partyAdapterToMDM,partyContextAdapterToMdm,partyDimensionAdapterToMDM,partyInquiryAdapterToMDM,partyInsertAdapterToMdm,partyMatchAdapterToMDM,partyRelationshipAdapterToMdm,partySearchAdapterToMDM,partyUpdateAdapterToMDM,personAdapterToMDM,phoneAdapterToMDM,updatePartyRelationsAdapterToMdm,addressAdapterToRule,govtIdInfoAdapterToRule,organizationAdapterToRule,partyAdapterToRule,personAdapterToRule,phoneAdapterToRule,standardizationAdapterToTrillium,addressAdapterFromMDM,alertsAdapterFromMDM,compositePartyInquiryAdapterFromMDM,emailAdapterFromMDM,govtIdInfoAdapterFromMDM,organizationAdapterFromMDM,organizationSearchAdapterFromMDM,partyAdapterFromMDM,partyInquiryAdapter! FromMDM,partyInsertAdapterFromMDM,partySearchAdapterFromMDM,partyUpdateAdapterFromMDM,personAdapterFromMDM,phoneAdapterFromMDM,relationAdapterFromMDM,ludAdapterToRule,requestPartyAdapterToRule,responsePartyAdapterToRule,suspectPartyAdapterToRule,addressAdapterFromRule,govtIdInfoAdapterFromRule,organizationAdapterFromRule,partyAdapterFromRule,personAdapterFromRule,phoneAdapterFromRule,standardizationAdapterFromTrillium,organizationSearchUtil,personSearchUtil,standardizationUtil,abstractWebServiceConnector,gpmCommonUtil,gpmDomainUtil,notificationMessageGenerator,globalPartyRuleImpl,survivorshipServiceImpl,gpmRuleUtil,survivorshipUtil,partyInquiryServiceImpl,partyInsertServiceImpl,partyUpdateServiceImpl,transactionLogServiceImpl,transactionLogger,globalPartyWS,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotatio! nProcessor,org.springframework.ws.server.endpoint.mapping.Payl! oadRootA
Re: [rules-users] KnowledgeAgent custom class loader not working for PKG resources
I forgot to mention that you will have to change your code a little bit. Instead of passing a KnowledgeBuilderConfiguration to the agent, you will need to add a configuration option to the KnowledgeAgentConfiguration object your are using: aconf.setProperty(drools.agent.useKBaseClassLoaderForCompiling, true); This way you are telling the agent to use the kbase's internal CL (We may set this as the default value I think). If you want to try my fix, this is what you need to do: - Prerequisites: java 1.5 or grater, maven 3.0.3 or grater and git 1.- $git clone git://github.com/droolsjbpm/drools.git drools (It will download all the sources and place them in drools directory) 2.- Get the fix from my repo. Fortunately, the fix is just one file: https://raw.github.com/esteban-aliverti/drools/61c2110df8c55c67ff532491865b3f28f368e8db/drools-core/src/main/java/org/drools/agent/impl/KnowledgeAgentImpl.java 3.- Replace the file /drools-core/src/main/java/org/drools/agent/impl/KnowledgeAgentImpl.java in your working copy with the file you downloaded in the previous step. 4.- $mvn clean install -DskipTests=true (this will compile everything and install the generated artifacts in your local maven repo) This could take some time. 5.- If in your project you are already using maven, then you just need to update the version of your dependencies to 5.4.0-SNAPSHOT. If you are not using maven, then you need to go to your local repo an get the generated drools-core-5.4.0-SNAPSHOT.jar and use it. Best Regards, Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Tue, Feb 21, 2012 at 7:52 PM, Hrumph herman.p...@imail.org wrote: Thanks Esteban. I’m not too adept with Git but will see what I can do.*** * ** ** ** ** Herm ** ** *From:* Esteban [via Drools] [mailto:[hidden email]http://user/SendEmail.jtp?type=nodenode=3764501i=0] *Sent:* Tuesday, February 21, 2012 11:10 AM *To:* Herman Post *Subject:* Re: [rules-users] KnowledgeAgent custom class loader not working for PKG resources ** ** I added some comments to the issue and provided a possible solution to it. I'm waiting for the review and comments from the core developers. In the meantime, if you have some skills with maven and git and you don't want to wait, you can create your own version of drools applying the provided patch to see if everything is ok. ** ** Best Regards, Esteban Aliverti - Developer @ click here. NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: RE: [rules-users] KnowledgeAgent custom class loader not working for PKG resourceshttp://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3764501.html Sent from the Drools: User forum mailing list archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.htmlat 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] MVEL Expression causing NPE in MVEL optimizer
I found the issue: I have to set all the globals before inserting any facts: cmds.add(CommandFactory.newSetGlobal( addressManager, addressManager, true)); ... cmds.add(CommandFactory.newInsert(event)); -- View this message in context: http://drools.46999.n3.nabble.com/MVEL-Expression-causing-NPE-in-MVEL-optimizer-tp3733427p3766434.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] Guvnor 5.4.0.Beta2 launch Error.
Hi Esteban, According to the tomcat log, guvnor was trying to connect to derby which I don't use, so it might have been caused by a preset condition in guvnor beta2 version? I scrapped my tomcat 6 and tried running it with Tomcat 7, this worked. Thanks. On 21/02/2012, at 6:30 PM, Esteban Aliverti esteban.alive...@gmail.com wrote: Esteban ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Declared model and drools.agent.newInstance
Thanks Esteban. I've tried a couple of workarounds, but it's still not working. :( -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-Declared-model-and-drools-agent-newInstance-tp3763280p374.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] KnowledgeAgent custom class loader not working for PKG resources
Thanks – I will try it this morning. Herm From: Esteban [via Drools] [mailto:ml-node+s46999n3765911...@n3.nabble.com] Sent: Wednesday, February 22, 2012 1:55 AM To: Herman Post Subject: Re: [rules-users] KnowledgeAgent custom class loader not working for PKG resources I forgot to mention that you will have to change your code a little bit. Instead of passing a KnowledgeBuilderConfiguration to the agent, you will need to add a configuration option to the KnowledgeAgentConfiguration object your are using: aconf.setProperty(drools.agent.useKBaseClassLoaderForCompiling, true); This way you are telling the agent to use the kbase's internal CL (We may set this as the default value I think). If you want to try my fix, this is what you need to do: - Prerequisites: java 1.5 or grater, maven 3.0.3 or grater and git 1.- $git clone git://github.com/droolsjbpm/drools.githttp://github.com/droolsjbpm/drools.git drools (It will download all the sources and place them in drools directory) 2.- Get the fix from my repo. Fortunately, the fix is just one file: https://raw.github.com/esteban-aliverti/drools/61c2110df8c55c67ff532491865b3f28f368e8db/drools-core/src/main/java/org/drools/agent/impl/KnowledgeAgentImpl.java 3.- Replace the file /drools-core/src/main/java/org/drools/agent/impl/KnowledgeAgentImpl.java in your working copy with the file you downloaded in the previous step. 4.- $mvn clean install -DskipTests=true (this will compile everything and install the generated artifacts in your local maven repo) This could take some time. 5.- If in your project you are already using maven, then you just need to update the version of your dependencies to 5.4.0-SNAPSHOT. If you are not using maven, then you need to go to your local repo an get the generated drools-core-5.4.0-SNAPSHOT.jar and use it. Best Regards, Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Tue, Feb 21, 2012 at 7:52 PM, Hrumph [hidden email]/user/SendEmail.jtp?type=nodenode=3765911i=0 wrote: Thanks Esteban. I’m not too adept with Git but will see what I can do. Herm From: Esteban [via Drools] [mailto:[hidden email]http://user/SendEmail.jtp?type=nodenode=3764501i=0] Sent: Tuesday, February 21, 2012 11:10 AM To: Herman Post Subject: Re: [rules-users] KnowledgeAgent custom class loader not working for PKG resources I added some comments to the issue and provided a possible solution to it. I'm waiting for the review and comments from the core developers. In the meantime, if you have some skills with maven and git and you don't want to wait, you can create your own version of drools applying the provided patch to see if everything is ok. Best Regards, Esteban Aliverti - Developer @ click here. NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml View this message in context: RE: [rules-users] KnowledgeAgent custom class loader not working for PKG resourceshttp://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3764501.html Sent from the Drools: User forum mailing list archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html at Nabble.com. ___ rules-users mailing list [hidden email]/user/SendEmail.jtp?type=nodenode=3765911i=1 https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list [hidden email]/user/SendEmail.jtp?type=nodenode=3765911i=2 https://lists.jboss.org/mailman/listinfo/rules-users If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/KnowledgeAgent-custom-class-loader-not-working-for-PKG-resources-tp3746456p3765911.html To unsubscribe from KnowledgeAgent custom class loader not working for PKG resources, click herehttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3746456code=SGVybWFuLlBvc3RAaW1haWwub3JnfDM3NDY0NTZ8NDA0OTE1Mzg5. NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context:
[rules-users] Yet another Schema question(s)...
Hi, I am configuring a drools server via spring and I need to execute a startup-command (as shown here http://lucazamador.wordpress.com/2010/05/27/drools-server-spring-configuration/). Seems straight forward until I started looking for .xsd files (specifically for http://drools.org/schema/drools-service-spring http://drools.org/schema/drools-service-spring.xsd). Like most drools code examples I find, these namespaces are broken since they are no longer hosted on drools.org. Even in recent books like Drools Developers Cookbook (which I am liking) he uses these invalid schema locationsurg. I'm working offline, so I normally have to poke around github, grepcode, etc etc looking for the files to download. Three questions: 1) Can someone point me to *drools-service-spring.xsd* 2) I see questions about schema location lots of times/places. Is someone on the Drools team looking into fixing this? 3) Why isn't everyone having an issue with this --- what am I missing? Thanks, -J -- View this message in context: http://drools.46999.n3.nabble.com/Yet-another-Schema-question-s-tp3767225p3767225.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] KnowledgeAgent custom class loader not working for PKG resources
I have a 5.4.0-SNAPSHOT version with your changes built and made the KnowledgeAgentConfiguration change you suggested. My test code is now like this: KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); aconf.setProperty(drools.agent.useKBaseClassLoaderForCompiling, true); // new // KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(test, kbase, aconf, kbuilderConfig); KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(test, kbase, aconf); // not passing kBuilderConfig My project is attached – let me know if it doesn’t upload. I can see I’m stepping threw your new code, and I’m now getting a new error, below. I can also tell you that we tried to just use the KnowledgeBuilder with custom classloader as in the Expert documentation (4.1.1) and could not get that to work either. Stack trace follows: java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:770) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1029) at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:812) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:671) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:202) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:181) at drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.createKnowledgeBase(KnowledgeAgentClassloaderTest.java:62) at drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.customClassloaderTest(KnowledgeAgentClassloaderTest.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.io.OptionalDataException at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1367) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at org.drools.rule.Pattern.readExternal(Pattern.java:118) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1810) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at java.util.ArrayList.readObject(ArrayList.java:733) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
Re: [rules-users] KnowledgeAgent custom class loader not working for PKG resources
Are you sure that the binary package was also created with the same drools version you are using in your tests? Best Regards, Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Wed, Feb 22, 2012 at 7:39 PM, Hrumph herman.p...@imail.org wrote: I have a 5.4.0-SNAPSHOT version with your changes built and made the KnowledgeAgentConfiguration change you suggested. My test code is now like this: ** ** KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); aconf.setProperty(drools.agent.useKBaseClassLoaderForCompiling, true); // new // KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(test, kbase, aconf, kbuilderConfig); KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(test, kbase, aconf); // not passing kBuilderConfig ** ** My project is attached – let me know if it doesn’t upload. ** ** I can see I’m stepping threw your new code, and I’m now getting a new error, below. ** ** I can also tell you that we tried to just use the KnowledgeBuilder with custom classloader as in the Expert documentation (4.1.1) and could not get that to work either. Stack trace follows: ** ** java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:770) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1029) at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:812) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:671) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:202) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:181) at drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.createKnowledgeBase(KnowledgeAgentClassloaderTest.java:62) at drools.cookbook.chapter02.KnowledgeAgentClassloaderTest.customClassloaderTest(KnowledgeAgentClassloaderTest.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)** ** at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.io.OptionalDataException at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1367) at
[rules-users] Drools Fusion: updating event duration
Hi all, i am using Drools Fusion in multi sensor data fusion system. I have some rules that generate a new event when some situations occur. But from the other hand, i would like to update the event, when i understand that new sensor observation is referring to the same event. I have my Event clazz with duration field, i try to update it in modify clause, but i have concern about it, because when i use temporal operator (such as before, meets, so on) it seems that Drools manage them as event with duration null. I could post the code too. Bye bye, Matteo. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] DROOLS Tohu
HI, i use drools tohu to create questionnaire for patients. can you help me install it and give me some tutorial? thanks a lot -- View this message in context: http://drools.46999.n3.nabble.com/DROOLS-Tohu-tp3767586p3767586.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 Fusion: updating event duration
A minimum but complete set of *.java and *.drl files would help. -W 2012/2/22 Matteo Cusmai cusmaimat...@gmail.com Hi all, i am using Drools Fusion in multi sensor data fusion system. I have some rules that generate a new event when some situations occur. But from the other hand, i would like to update the event, when i understand that new sensor observation is referring to the same event. I have my Event clazz with duration field, i try to update it in modify clause, but i have concern about it, because when i use temporal operator (such as before, meets, so on) it seems that Drools manage them as event with duration null. I could post the code too. Bye bye, Matteo. ___ 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] Drools Fusion: updating event duration
Hi Wolfgang, this is an extract of drl file: declare GasObservation @role(event) @startTimestamp(timestamp) @expires( 10s ) @duration(duration) end declare GasEvent @startTimestamp(timestampDate) @role(event) @duration(duration) end rule gas1-event no-loop when $obs: GasObservation( $obsLocation : location, gasname == UN 1017, value 60 ) over window:length(1) from entry-point lowLevelSensorStream not GasEvent( location geoIsWithinDistance[ 5m ] $obsLocation, gasname == UN 1017, this before[1s, 25s] $obs ) then insert(new GasEvent( $obs, UN 1017 value threshold[60], Event.THREAT_HIGH, $obsLocation, $obs.getSensor())); end rule gas1-event-update no-loop when $obs: GasObservation( $obsLocation : location, gasname == UN 1017, value 60 ) over window:length(1) from entry-point lowLevelSensorStream $event : GasEvent( location geoIsWithinDistance[ 5m ] $obsLocation, gasname == UN 1017, this before[1s, 25s] $obs ) then modify($event) { updateDuration(), addObservation($obs) } end and these are abstract Observation class and abstract Event public abstract class Observation implements Serializable { /** * */ private static final long serialVersionUID = 3483256523801072709L; private long timestamp; private long duration; private Geometry location; private Sensor sensor; public long getTimestamp() { return timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; } public long getDuration() { return duration; } public void setDuration(long duration) { this.duration = duration; } public Sensor getSensor() { return sensor; } public void setSensor(Sensor sensor) { this.sensor = sensor; } public Geometry getLocation() { return location; } public void setLocation(Geometry location) { this.location = location; } /** * @param newTimeStamp * this methods allows to update the duration of event by setting the timestamp of new observation. */ public void updateDuration(long newTimeStamp) { setDuration(newTimeStamp - getTimestamp()); } public Date getTimestampDate() { return new Date(timestamp); } public void setTimestampDate(Date timestamp) { this.timestamp = timestamp.getTime(); } public Observation(Sensor sensor, Geometry location, long timestamp) { this.setLocation(location); this.setTimestamp( timestamp ); this.setSensor( sensor ); } /** * @return identification by servicename:timestamp */ public String getServiceIdentification() { return getSensor().getServiceName() + : + getTimestamp() ; } } public abstract class Event implements Serializable { . /** * */ private static final long serialVersionUID = 1L; /** * The timestamp of event. */ private long timestamp; /** * The level of threat of the event. */ private int threat_level; /** * The description of event. */ private String description; /** * The location of event. */ private Geometry location; /** * Duration of event. */ private long duration; /** * Id of sensor. */ private Sensor sensor; /** * The map feature involved into Event. */ private MapFeature feature; /** * link to the timestamp of parent event. */ private long parent; private CollectionObservation observations; private CollectionEvent relatedEvents; public abstract int getType(); public CollectionObservation getObservations() { return observations; } public void addObservation(Observation obs) { observations.add(obs); } public CollectionEvent getRelatedEvents() { return relatedEvents; } public void addRelatedEvent(Event evnt) { relatedEvents.add(evnt); } public Sensor getSensor() { return sensor; } public void setSensor(Sensor sensorId) { this.sensor = sensorId; } public long getDuration() { return duration; } public void setDuration(long duration) { this.duration = duration; } public int getThreat_level() { return threat_level; } public void setThreat_level(int threatLevel) { threat_level = threatLevel; } /** * @param newTimeStamp * this methods allows to update the duration of event by setting the timestamp of new observation. */ public void updateDuration() { setDuration(System.currentTimeMillis() - getTimestamp()); } public long getTimestamp() { return timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; } public Date getTimestampDate() { return new Date(timestamp); } public void setTimestampDate(Date timestamp) { this.timestamp = timestamp.getTime(); } public String getDescription() { return description; }
Re: [rules-users] Drools Fusion: updating event duration
Unfortunately you can't update event durations or timestamp. Events are supposed to represent things that happened and as so, are immutable (other than data enrichment). If an event representation is no longer true, that event has to be retracted. Most common case is when you are dealing with atomic events (like start and end atomic events) that represent a complex event. Usually you will have a rule that correlates the start and end atomic events and creates a complex derived event, retracting the atomic ones. Edson 2012/2/22 Matteo Cusmai cusmaimat...@gmail.com Hi all, i am using Drools Fusion in multi sensor data fusion system. I have some rules that generate a new event when some situations occur. But from the other hand, i would like to update the event, when i understand that new sensor observation is referring to the same event. I have my Event clazz with duration field, i try to update it in modify clause, but i have concern about it, because when i use temporal operator (such as before, meets, so on) it seems that Drools manage them as event with duration null. I could post the code too. Bye bye, Matteo. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by 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] Drools Fusion: updating event duration
Hi Edson, so, when i want modify an event, i could do as follow: - clone event; - change the duration - retract the previuos event - insert the new event Is it right? Bye bye, Matteo. 2012/2/22 Edson Tirelli ed.tire...@gmail.com Unfortunately you can't update event durations or timestamp. Events are supposed to represent things that happened and as so, are immutable (other than data enrichment). If an event representation is no longer true, that event has to be retracted. Most common case is when you are dealing with atomic events (like start and end atomic events) that represent a complex event. Usually you will have a rule that correlates the start and end atomic events and creates a complex derived event, retracting the atomic ones. Edson 2012/2/22 Matteo Cusmai cusmaimat...@gmail.com Hi all, i am using Drools Fusion in multi sensor data fusion system. I have some rules that generate a new event when some situations occur. But from the other hand, i would like to update the event, when i understand that new sensor observation is referring to the same event. I have my Event clazz with duration field, i try to update it in modify clause, but i have concern about it, because when i use temporal operator (such as before, meets, so on) it seems that Drools manage them as event with duration null. I could post the code too. Bye bye, Matteo. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.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] jboss tohu
hi, can you help me to install tohu and thanks sir? -- View this message in context: http://drools.46999.n3.nabble.com/jboss-tohu-tp3767998p3767998.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] jboss tohu
As far as I know tohu is abandoned, we were working in a new experimental version but there is nothing finished yet. My two cents - CTO @ http://www.plugtree.com - MyJourney @ http://salaboy.wordpress.com - Co-Founder @ http://www.jbug.com.ar - Mauricio Salaboy Salatino - On 22/02/2012, at 21:58, olfa h.olf...@gmail.com wrote: hi, can you help me to install tohu and thanks sir? View this message in context: jboss tohu 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] Drools Fusion: updating event duration
If your use case somehow has mutable events, you can retract, change the duration and reinsert. The engine uses optimizations for the temporal reasoning that are based on the fact that events should be immutable. That is why the engine resolves the timestamp/duration attributes at insert time and make them immutable. Edson 2012/2/22 Matteo Cusmai cusmaimat...@gmail.com Hi Edson, so, when i want modify an event, i could do as follow: - clone event; - change the duration - retract the previuos event - insert the new event Is it right? Bye bye, Matteo. 2012/2/22 Edson Tirelli ed.tire...@gmail.com Unfortunately you can't update event durations or timestamp. Events are supposed to represent things that happened and as so, are immutable (other than data enrichment). If an event representation is no longer true, that event has to be retracted. Most common case is when you are dealing with atomic events (like start and end atomic events) that represent a complex event. Usually you will have a rule that correlates the start and end atomic events and creates a complex derived event, retracting the atomic ones. Edson 2012/2/22 Matteo Cusmai cusmaimat...@gmail.com Hi all, i am using Drools Fusion in multi sensor data fusion system. I have some rules that generate a new event when some situations occur. But from the other hand, i would like to update the event, when i understand that new sensor observation is referring to the same event. I have my Event clazz with duration field, i try to update it in modify clause, but i have concern about it, because when i use temporal operator (such as before, meets, so on) it seems that Drools manage them as event with duration null. I could post the code too. Bye bye, Matteo. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.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 -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Loading rules performance problem in 5.4.0.Beta2 compare to 5.0.1
Hi all, I'm planning to upgrade to Drools 5.4.0.Beta2 from 5.0.1. However when testing the performance w.r.t rules loading, 5.4.0.Beta2 is not only much slower (50% slower) but also eats more memory compare to 5.0.1. Is it something expected from 5.4.0.Beta2 to compensate other fixes/features? Thanks, Trung -- View this message in context: http://drools.46999.n3.nabble.com/Loading-rules-performance-problem-in-5-4-0-Beta2-compare-to-5-0-1-tp3768609p3768609.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] Filtering inside the LHS
Hi All, I am seeking some kind of filtering (if statement) inside the LHS. I have the following example rule (note: $attributeFilteredSentences and $cmdescriptor are defined in the extends rule which is not presented): rule choose message sentence example extends attributeFilteredSentences collection when SContextState(state == SContextState.ONE) $sentences: ArrayList() from collect (Sentences.Sentence( descriptor.meanings.meaning == $cmdescriptor.meanings.meaning ) from $attributeFilteredSentences) then logger.info(RULE: entered rule: +drools.getRule().getName()); //some logic. end as can be seen I am filtering sentences based on the meanings, and the meaning collection must be identical as in $cmdescriptor (this is the case when SContextState.ONE) Now to my question: I have cases ((this is the case when SContextState.TWO) where I do not need exact validation but rather superset of (for this I have a supersetOf operator implemented) I would like to avoid duplicating this rule (as I have similar condition in many other rules) and being able to filter once with == and once with supersetOf depending on the SContextState. Any ideas how to do this? Thanks, Hezi ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Getting Involved - Some help docs
I just updated the docs with a Getting Involved section, which covers questions we are asked often. The chapter provides high level info on how you sign up, submit issues, submit pull requests, best practice for tests etc. Please provide feedback, or pull requests, for improvements and this will be part of the documentation for the up coming 5.4 release. I placed a built version of the docs temporarily on the following url, for review: http://www.athico.com/Getting_Involved/gettinginvolved.html You can see and edit the src here: https://github.com/droolsjbpm/droolsjbpm-knowledge/blob/master/droolsjbpm-introduction-docs/src/main/docbook/en-US/Chapter-Getting_Involved/Chapter-Getting_Involved.xml Mark ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Loading rules performance problem in 5.4.0.Beta2 compare to 5.0.1
On 23/02/2012 03:29, erolagnab wrote: Hi all, I'm planning to upgrade to Drools 5.4.0.Beta2 from 5.0.1. However when testing the performance w.r.t rules loading, 5.4.0.Beta2 is not only much slower (50% slower) but also eats more memory compare to 5.0.1. Is it something expected from 5.4.0.Beta2 to compensate other fixes/features? 5.4 has a significantly more power which makes the build process more complex and thus slower. However we've never actually profiled the build process to attempt to improve it's performance or reduce memory. We won't get around to improving those for 5.4, but we will address it as some point in the future, I know that Mario is itching to get parallel rule building :) As always code contributions are welcome :) Mark Thanks, Trung -- View this message in context: http://drools.46999.n3.nabble.com/Loading-rules-performance-problem-in-5-4-0-Beta2-compare-to-5-0-1-tp3768609p3768609.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] Filtering inside the LHS
On 23/02/2012 03:38, Hezi Stern wrote: Hi All, I am seeking some kind of filtering (if statement) inside the LHS. I have the following example rule (note: $attributeFilteredSentences and $cmdescriptor are defined in the extends rule which is not presented): *rule* choose message sentence exampleextends attributeFilteredSentences collection *when* SContextState(state == SContextState.ONE) $sentences: ArrayList() *from**collect*(Sentences.Sentence( descriptor.meanings.meaning == $cmdescriptor.meanings.meaning ) *from* $attributeFilteredSentences) *then* logger.info(RULE: entered rule: +drools.getRule().getName()); //some logic... *end* ** as can be seen I am filtering sentences based on the meanings, and the meaning collection must be identical as in $cmdescriptor (this is the case when SContextState.ONE) Now to my question: I have cases ((this is the case when SContextState.TWO) where I do not need exact validation but rather superset of (for this I have a supersetOf operator implemented) I would like to avoid duplicating this rule (as I have similar condition in many other rules) and being able to filter once with == and once with supersetOf depending on the SContextState. I have found that query's can be used to provide re-usable rule fragments. In the example below I could have inlined the intentory LHS in the updateInventory rule, but instead I separated it out into a query so that multiple rules can re-use it. There is a small performance overhead from using queries, compared to normal patterns, but in most cases this is compensated by more maintainable and readable code. query inventory(Character $char, List $inventory) $char := Character() $inventory := List() from accumulate( Holding( $char, $thing; ), collectList( $thing ) ) end rule updateInventory salience 5 when SessionCharacter( $char : character, $us : session ) inventory( $char, $things; ) then $us.channels[inventory].send( $things ); end Mark Any ideas how to do this? Thanks, Hezi ___ 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] Drools Fusion: updating event duration
On 22/02/2012, Edson Tirelli ed.tire...@gmail.com wrote: If your use case somehow has mutable events, you can retract, change the duration and reinsert. But mind the requirements of STREAM mode: Events in each stream must be time-ordered. I.e., inside a given stream, events that happened first must be inserted first into the engine. If reinsertions would violate this, you must run the session in CLOUD mode, which has certain consequences. This is all very well described in the Fusion manual, section on Event Processing Modes. -W The engine uses optimizations for the temporal reasoning that are based on the fact that events should be immutable. That is why the engine resolves the timestamp/duration attributes at insert time and make them immutable. Edson 2012/2/22 Matteo Cusmai cusmaimat...@gmail.com Hi Edson, so, when i want modify an event, i could do as follow: - clone event; - change the duration - retract the previuos event - insert the new event Is it right? Bye bye, Matteo. 2012/2/22 Edson Tirelli ed.tire...@gmail.com Unfortunately you can't update event durations or timestamp. Events are supposed to represent things that happened and as so, are immutable (other than data enrichment). If an event representation is no longer true, that event has to be retracted. Most common case is when you are dealing with atomic events (like start and end atomic events) that represent a complex event. Usually you will have a rule that correlates the start and end atomic events and creates a complex derived event, retracting the atomic ones. Edson 2012/2/22 Matteo Cusmai cusmaimat...@gmail.com Hi all, i am using Drools Fusion in multi sensor data fusion system. I have some rules that generate a new event when some situations occur. But from the other hand, i would like to update the event, when i understand that new sensor observation is referring to the same event. I have my Event clazz with duration field, i try to update it in modify clause, but i have concern about it, because when i use temporal operator (such as before, meets, so on) it seems that Drools manage them as event with duration null. I could post the code too. Bye bye, Matteo. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.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 -- Edson Tirelli JBoss Drools Core Development JBoss by Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users