<div style="font-family: 'Times New Roman'; font-size: 16px;">Thanks Wolfgang, I have figured out the problem. I had logical errors with my Java implementations.<br _moz_dirty="" /><br _moz_dirty="" />Regards,<br _moz_dirty="" />DL<br /><br /><span>On 04/04/12, rules-users-request@lists.jboss.org wrote:</span><blockquote cite="mid:mailman.1046.1333548769.6239.rules-users@lists.jboss.org" class="iwcQuote" style="border-left: 1px solid rgb(0, 0, 255); padding-left: 13px; margin-left: 0pt;" type="cite"><div class="mimepart text plain">Send rules-users mailing list submissions to<br />        rules-users@lists.jboss.org<br /><br />To subscribe or unsubscribe via the World Wide Web, visit<br />        <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br />or, via email, send a message with subject or body 'help' to<br />        rules-users-request@lists.jboss.org<br /><br />You can reach the person managing the list at<br />        rules-users-owner@lists.jboss.org<br /><br />When replying, please edit your Subject line so it is more specific<br />than &quot;Re: Contents of rules-users digest...&quot;<br /><br /><br />Today's Topics:<br /><br />   1. How to use multiple objects of the same class in RHS<br />      (Dennis Lupiana)<br />   2. Re: How to use multiple objects of the same class in        RHS<br />      (Wolfgang Laun)<br />   3. Re: mvel strict-mode not applied in drools 5.3.1.Final<br />      (Mark Proctor)<br />   4. Re: mvel strict-mode not applied in drools 5.3.1.Final<br />      (Wolfgang Laun)<br />   5. Re: mvel strict-mode not applied in drools 5.3.1.Final<br />      (Mark Proctor)<br />   6. Re: KnowledgeAgent Changeset problems (albertorugnone)<br /><br /><br />----------------------------------------------------------------------<br /><br />Message: 1<br />Date: Wed, 04 Apr 2012 12:42:00 +0100<br />From: &quot;Dennis Lupiana&quot; &lt;Dennis.Lupiana@dit.ie&gt;<br />Subject: [rules-users] How to use multiple objects of the same class<br />        in RHS<br />To: rules-users@lists.jboss.org<br />Message-ID: &lt;7480f0694e64.4f7c4198@dit.ie&gt;<br />Content-Type: text/plain; charset=&quot;us-ascii&quot;<br /><br />An HTML attachment was scrubbed...<br />URL: <a href="http://lists.jboss.org/pipermail/rules-users/attachments/20120404/961f91c9/attachment-0001.html" target="_blank">http://lists.jboss.org/pipermail/rules-users/attachments/20120404/961f91c9/attachment-0001.html</a> <br /><br />------------------------------<br /><br />Message: 2<br />Date: Wed, 4 Apr 2012 14:40:57 +0200<br />From: Wolfgang Laun &lt;wolfgang.laun@gmail.com&gt;<br />Subject: Re: [rules-users] How to use multiple objects of the same<br />        class in        RHS<br />To: Rules Users List &lt;rules-users@lists.jboss.org&gt;<br />Message-ID:<br />        &lt;CANaj1Ld8sid373xXD9Beh7YMqfA86JuiSrwLkDuXYrYq2_=ioQ@mail.gmail.com&gt;<br />Content-Type: text/plain; charset=ISO-8859-1<br /><br />On 04/04/2012, Dennis Lupiana &lt;Dennis.Lupiana@dit.ie&gt; wrote:<br />&gt; Please help.<br />&gt; -----------<br />&gt;<br />&gt; I have inserted four objects of the same type in the working memory using<br />&gt; array.<br /><br />There's no point in inserting an array Person[]. Insert Person objects.<br /><br />&gt; I want to write a rule which will be activated when certain values in<br />&gt; the objects are met. Let say my object is Person and it has a username field<br />&gt; with values John, Peter, Jane and Judy for each object. I want to write a<br />&gt; rule that will be activated when username is Peter and Jane.<br /><br />One name can only have one value. Do you mean &quot;when there is one<br />Person with username &quot;Peter&quot; and another Person &quot;Jane&quot;?<br /><br />when<br />   Person( username == &quot;Peter&quot; )<br />   Person( username == &quot;Jane&quot; )<br />then<br />   ...<br /><br /><br />&gt;<br />&gt; Thanks<br />&gt; --------<br /><br /><br />------------------------------<br /><br />Message: 3<br />Date: Wed, 04 Apr 2012 13:54:19 +0100<br />From: Mark Proctor &lt;mproctor@codehaus.org&gt;<br />Subject: Re: [rules-users] mvel strict-mode not applied in drools<br />        5.3.1.Final<br />To: rules-users@lists.jboss.org<br />Message-ID: &lt;4F7C447B.7010504@codehaus.org&gt;<br />Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br /><br />On 04/04/2012 12:32, muenchen@korgen.de wrote:<br />&gt;<br />&gt; Hi Mark,<br />&gt; Thanks for your reply, but the row in the drl the error occurs on is <br />&gt; in an eval.what do you mean by explicit?<br />&gt; anyway this does not explain why it runs on jdk1.6 but not on 1.7.<br />&gt;<br />You had two questions. The question you ahve about JDK1.7 are already <br />answered in the JIRA. I'm talking about strict mode. If you use the <br />eval(....) CE like that, it shoud obey the static mvel strict setting. <br />If it does not, it's a bug, please file a jira with a self contained <br />unit test See &quot;getting involved&quot; for how to submit unit tests:<br /><a href="https://hudson.jboss.org/hudson/job/droolsjbpm-knowledge/lastSuccessfulBuild/artifact/droolsjbpm-introduction-docs/target/docbook/publish/en-US/html_single/index.html#gettingstarted" target="_blank">https://hudson.jboss.org/hudson/job/droolsjbpm-knowledge/lastSuccessfulBuild/artifact/droolsjbpm-introduction-docs/target/docbook/publish/en-US/html_single/index.html#gettingstarted</a><br /><br />Mark<br />&gt;<br />&gt; Best<br />&gt;<br />&gt; J?rg<br />&gt;<br />&gt; sent from a mobile device<br />&gt;<br />&gt; On Apr 4, 2012 12:55 PM, &quot;Mark Proctor&quot; &lt;mproctor@codehaus.org <br />&gt; &lt;mailto:mproctor@codehaus.org &lt;mproctor@codehaus.org&gt;&gt;&gt; wrote:<br />&gt;<br />&gt;     On 04/04/2012 11:04, korgen wrote:<br />&gt;     &gt; Hi folks,<br />&gt;     &gt; In the process of upgrading from Java 1.6 to Java 1.7 (1.7.0_03<br />&gt;     to be<br />&gt;     &gt; precise) we updated Drools from 5.1.1 to 5.3.1 (as in 5.1.1<br />&gt;     language level<br />&gt;     &gt; 1.7 is not supported).<br />&gt;     &gt;<br />&gt;     &gt; However with Drools 5.3.1 the system property<br />&gt;     &quot;drools.dialect.mvel.strict&quot;<br />&gt;     &gt; seems not to be applied all the time. I know this sounds fishy,<br />&gt;     but this is<br />&gt;     &gt; the behaviour:<br />&gt;     MVEL strictness is only applied to explicite eval, consequence, return<br />&gt;     values and accumulates.<br />&gt;<br />&gt;     It's not applied to field constaints. We foudn some points, around<br />&gt;     collections, where type safeness for constraints is not enforced and<br />&gt;     have strengthened that. You can still get type unsafe execution, by<br />&gt;     using the typesfalse(false), for the specific pattern. We don't<br />&gt;     like to<br />&gt;     encourage lack of type safety, as it creates difficult to maintain<br />&gt;     systems and will not benefit from performance enhancements we do on<br />&gt;     bytecode generation.<br />&gt;<br />&gt;     Mark<br />&gt;     &gt;<br />&gt;     &gt; In a (junit based) test we create the knowledgebase by loading<br />&gt;     multiple drl<br />&gt;     &gt; files. Each of them has the dialect 'mvel' set in its beginning.<br />&gt;     &gt; In our @BeforeClass of the test we do a:<br />&gt;     &gt; System.setProperty(&quot;drools.dialect.mvel.strict&quot;, &quot;false&quot;);<br />&gt;     &gt;<br />&gt;     &gt; and I also tried using a KnowledgeBuilderConfiguration with the<br />&gt;     appropriate<br />&gt;     &gt; settings.<br />&gt;     &gt; But still sometimes the test fails with a &quot;unable to resolve<br />&gt;     method using<br />&gt;     &gt; strict-mode...&quot; message. I say sometime because running the test<br />&gt;     multiple<br />&gt;     &gt; times via maven &quot;mvn -Dtest=ClassicDroolsTest test&quot; sometimes<br />&gt;     produces<br />&gt;     &gt; failure, sometimes produces success.<br />&gt;     &gt; It might by noteworthy that the method called in the test<br />&gt;     expects two<br />&gt;     &gt; parameters of type Double, but as it seems Drools is not seeing the<br />&gt;     &gt; covariant return type of the class which is actually used (the<br />&gt;     abstract base<br />&gt;     &gt; method has return type Object, the concrete method has return<br />&gt;     type Double).<br />&gt;     &gt;<br />&gt;     &gt; I tried to reproduce the issue with a simpler test setup to be<br />&gt;     able to post<br />&gt;     &gt; it here but did not succeed.<br />&gt;     &gt;<br />&gt;     &gt; I also applied the patch<br />&gt;     &gt;<br />&gt;     <a href="https://github.com/droolsjbpm/drools/commit/1c20018abeef8bee86f896ffff7945404cebb18f" target="_blank">https://github.com/droolsjbpm/drools/commit/1c20018abeef8bee86f896ffff7945404cebb18f</a><br />&gt;     &gt; (comming from <a href="https://issues.jboss.org/browse/JBRULES-3163%29" target="_blank">https://issues.jboss.org/browse/JBRULES-3163)</a> to<br />&gt;     the Drools<br />&gt;     &gt; 5.1.1 sources, compiled them myself and everything works like a<br />&gt;     charm with<br />&gt;     &gt; it. However I cannot use this unofficial work around as I can't<br />&gt;     (and don't<br />&gt;     &gt; want) use a patched version of Drools in my environment.<br />&gt;     &gt; Also when I compile&amp;  run my sources with jdk 1.6.0_31<br />&gt;     everything is fine.<br />&gt;     &gt;<br />&gt;     &gt; I'd really appreciate any help on this topic as I couldn't find<br />&gt;     any hints on<br />&gt;     &gt; this behaviour in the release notes from Drools versions&gt;  5.1.1<br />&gt;     &gt;<br />&gt;     &gt; Thanks<br />&gt;     &gt;<br />&gt;     &gt; Joerg<br />&gt;     &gt;<br />&gt;     &gt; --<br />&gt;     &gt; View this message in context:<br />&gt;     <a href="http://drools.46999.n3.nabble.com/mvel-strict-mode-not-applied-in-drools-5-3-1-Final-tp3883669p3883669.html" target="_blank">http://drools.46999.n3.nabble.com/mvel-strict-mode-not-applied-in-drools-5-3-1-Final-tp3883669p3883669.html</a><br />&gt;     &gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br />&gt;     &gt; _______________________________________________<br />&gt;     &gt; rules-users mailing list<br />&gt;     &gt; rules-users@lists.jboss.org &lt;mailto:rules-users@lists.jboss.org &lt;rules-users@lists.jboss.org&gt;&gt;<br />&gt;     &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br />&gt;<br />&gt;     _______________________________________________<br />&gt;     rules-users mailing list<br />&gt;     rules-users@lists.jboss.org &lt;mailto:rules-users@lists.jboss.org &lt;rules-users@lists.jboss.org&gt;&gt;<br />&gt;     <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br />&gt;<br />&gt;<br />&gt;<br />&gt; _______________________________________________<br />&gt; rules-users mailing list<br />&gt; rules-users@lists.jboss.org<br />&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br /><br /><br />-------------- next part --------------<br />An HTML attachment was scrubbed...<br />URL: <a href="http://lists.jboss.org/pipermail/rules-users/attachments/20120404/aac7ced2/attachment-0001.html" target="_blank">http://lists.jboss.org/pipermail/rules-users/attachments/20120404/aac7ced2/attachment-0001.html</a> <br /><br />------------------------------<br /><br />Message: 4<br />Date: Wed, 4 Apr 2012 15:23:12 +0200<br />From: Wolfgang Laun &lt;wolfgang.laun@gmail.com&gt;<br />Subject: Re: [rules-users] mvel strict-mode not applied in drools<br />        5.3.1.Final<br />To: Rules Users List &lt;rules-users@lists.jboss.org&gt;<br />Message-ID:<br />        &lt;CANaj1LfVJpE+s3VZgfX-yh9KupZ8t61NzPG_mCpc_UKKAiLPxA@mail.gmail.com&gt;<br />Content-Type: text/plain; charset=ISO-8859-1<br /><br />@J?rg:<br /><br />&gt;&gt;     On 04/04/2012 11:04, korgen wrote:<br />&gt;&gt;    we updated Drools from 5.1.1 to 5.3.1 (as in 5.1.1<br />&gt;&gt;     language level<br />&gt;&gt;     &gt; 1.7 is not supported).<br /><br />Why would Drools 5.1.1. not be usable with Java 1.7? Byte code is<br />supposed to be upward compatible.<br /><br />-W<br /><br /><br /><br />------------------------------<br /><br />Message: 5<br />Date: Wed, 04 Apr 2012 14:25:30 +0100<br />From: Mark Proctor &lt;mproctor@codehaus.org&gt;<br />Subject: Re: [rules-users] mvel strict-mode not applied in drools<br />        5.3.1.Final<br />To: rules-users@lists.jboss.org<br />Message-ID: &lt;4F7C4BCA.60809@codehaus.org&gt;<br />Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br /><br />On 04/04/2012 14:23, Wolfgang Laun wrote:<br />&gt; @J?rg:<br />&gt;<br />&gt;&gt;&gt;      On 04/04/2012 11:04, korgen wrote:<br />&gt;&gt;&gt;     we updated Drools from 5.1.1 to 5.3.1 (as in 5.1.1<br />&gt;&gt;&gt;      language level<br />&gt;&gt;&gt;      &gt;  1.7 is not supported).<br />&gt; Why would Drools 5.1.1. not be usable with Java 1.7? Byte code is<br />&gt; supposed to be upward compatible.<br />Read the jira at the start of the thread:<br /><a href="https://issues.jboss.org/browse/JBRULES-3163" target="_blank">https://issues.jboss.org/browse/JBRULES-3163</a><br /><br />It provides a pull request that shows the problem. The JCI code is old <br />and didn't have version detections for 1.7:<br /><a href="https://github.com/droolsjbpm/drools/pull/42" target="_blank">https://github.com/droolsjbpm/drools/pull/42</a><br /><br />Mark<br />&gt;<br />&gt; -W<br />&gt;<br />&gt; _______________________________________________<br />&gt; rules-users mailing list<br />&gt; rules-users@lists.jboss.org<br />&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br /><br /><br /><br />------------------------------<br /><br />Message: 6<br />Date: Wed, 4 Apr 2012 07:12:47 -0700 (PDT)<br />From: albertorugnone &lt;arugnonechemical@gmail.com&gt;<br />Subject: Re: [rules-users] KnowledgeAgent Changeset problems<br />To: rules-users@lists.jboss.org<br />Message-ID: &lt;1333548767225-3884201.post@n3.nabble.com&gt;<br />Content-Type: text/plain; charset=us-ascii<br /><br />Thank you every body for your answer, unfortunately I was't able to reply to<br />you until now because other stuff overwhelmed me literally at work.<br />Anyway I was going ahead using KnowledgeAgent, following your comments and<br />other suggestion. Now I am able to load rules applying change set with<br />KnowledgeAgent (thank you!!!), but honestly this is a poor success because,<br />even if when I change the rule KnowledgeAgent says &quot;incremental build of<br />KnowledgeBase finished and in use&quot; nothing changes. <br />It seems that changes at rules have no effect and it is pretty weird. I made<br />a maven project with eclipse to explain you better my problem. Is a simple<br />main. I am working for a better junit test. Anyway if you change the rule in<br />the folder knowledge you can test the problem by yourself.<br />Briefly I will explain the project:<br /><br />Here the code:<br /><br />                _l.warn(&quot;START&quot;);<br />                String xml = &quot;&quot;;<br />                xml += &quot;&lt;change-set xmlns='<a href="http://drools.org/drools-5.0/change-set%27%22;" target="_blank">http://drools.org/drools-5.0/change-set'&quot;;</a><br />                xml += &quot;   <br />xmlns:xs='<a href="http://www.w3.org/2001/XMLSchema-instance%27%22;" target="_blank">http://www.w3.org/2001/XMLSchema-instance'&quot;;</a><br />                xml += &quot;   <br />xs:schemaLocation='<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a><br />drools-change-set-5.0.xsd' &gt;&quot;;<br />                xml += &quot;    &lt;add&gt; &quot;;<br />                xml += &quot;        &lt;resource source='Z:/EXP/drools-test/knowledge/test.drl'<br />type='DRL' /&gt;&quot;;<br />                xml += &quot;    &lt;/add&gt; &quot;;<br />                xml += &quot;&lt;/change-set&gt;&quot;;<br />                FileManager fileManager = new FileManager();<br />                File fxml = fileManager.newFile(&quot;changeset.xml&quot;);<br />                Writer output = new BufferedWriter(new FileWriter(fxml));<br />                output.write(xml);<br />                output.close();<br />                // build a KnowledgeAgent<br />                ResourceFactory.getResourceChangeNotifierService()<br />                                                .start();<br />                ResourceFactory.getResourceChangeScannerService()<br />                                                .start();<br /><br />                final ResourceChangeScannerConfiguration sconf =<br />ResourceFactory.getResourceChangeScannerService()<br />                                                                                                                                                .newResourceChangeScannerConfiguration();<br />                sconf.setProperty(&quot;drools.resource.scanner.interval&quot;, &quot;2&quot;);<br />                ResourceFactory.getResourceChangeScannerService()<br />                                                .configure(sconf);<br /><br />                final KnowledgeAgentConfiguration aconf =<br />KnowledgeAgentFactory.newKnowledgeAgentConfiguration();<br />                aconf.setProperty(&quot;drools.agent.scanDirectories&quot;, &quot;true&quot;);<br />                aconf.setProperty(&quot;drools.agent.scanResources&quot;, &quot;true&quot;);<br />                /*<br />                 * important newInstance has to be false in order to update the<br />                 * knowledge base and not rebuild a new one<br />                 */<br />                aconf.setProperty(&quot;drools.agent.newInstance&quot;, &quot;false&quot;);<br />                final KnowledgeAgent agent =<br />KnowledgeAgentFactory.newKnowledgeAgent(&quot;pch.sel.knowledge.agent&quot;, aconf);<br />                // if (_l.isDebugEnabled()) {<br />                /* we need some log every time */<br />                agent.setSystemEventListener(new PrintStreamSystemEventListener());<br />        <br />agent.applyChangeSet(ResourceFactory.newClassPathResource(&quot;pch.sel.kwset.xml&quot;));<br />                // fire rules<br />                StatefulKnowledgeSession session =<br />agent.getKnowledgeBase().newStatefulKnowledgeSession();<br />                session.fireAllRules();<br />                _l.warn(&quot;END&quot;);<br /><br /><br />and here the rule<br /><br /><br />package it.ipiu.drools.KnowledgeAgent.test<br /><br />rule &quot;test rule&quot; timer(int: 0s 2s)<br />    when<br />        eval(true);<br />    then<br />            System.out.println(&quot;ciao&quot;);<br />end<br /><br /><br /><br />If I try to change timer from 2s to 2m nothing changes even if<br />KnowledgeAgent seems to reload all. <br /><br />*Please help!!! I googled the problem everywhere without solution!!!*<br /><br /><br /><br />--<br />View this message in context: <a href="http://drools.46999.n3.nabble.com/KnowledgeAgent-Changeset-problems-tp3787165p3884201.html" target="_blank">http://drools.46999.n3.nabble.com/KnowledgeAgent-Changeset-problems-tp3787165p3884201.html</a><br />Sent from the Drools: User forum mailing list archive at Nabble.com.<br /><br /><br />------------------------------<br /><br />_______________________________________________<br />rules-users mailing list<br />rules-users@lists.jboss.org<br /><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br /><br /><br />End of rules-users Digest, Vol 65, Issue 13<br />*******************************************<br /></div></blockquote></div>