<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 "Re: Contents of rules-users digest..."<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: "Dennis Lupiana" <Dennis.Lupiana@dit.ie><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: <7480f0694e64.4f7c4198@dit.ie><br />Content-Type: text/plain; charset="us-ascii"<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 <wolfgang.laun@gmail.com><br />Subject: Re: [rules-users] How to use multiple objects of the same<br />        class in        RHS<br />To: Rules Users List <rules-users@lists.jboss.org><br />Message-ID:<br />        <CANaj1Ld8sid373xXD9Beh7YMqfA86JuiSrwLkDuXYrYq2_=ioQ@mail.gmail.com><br />Content-Type: text/plain; charset=ISO-8859-1<br /><br />On 04/04/2012, Dennis Lupiana <Dennis.Lupiana@dit.ie> wrote:<br />> Please help.<br />> -----------<br />><br />> I have inserted four objects of the same type in the working memory using<br />> array.<br /><br />There's no point in inserting an array Person[]. Insert Person objects.<br /><br />> I want to write a rule which will be activated when certain values in<br />> the objects are met. Let say my object is Person and it has a username field<br />> with values John, Peter, Jane and Judy for each object. I want to write a<br />> rule that will be activated when username is Peter and Jane.<br /><br />One name can only have one value. Do you mean "when there is one<br />Person with username "Peter" and another Person "Jane"?<br /><br />when<br /> Person( username == "Peter" )<br /> Person( username == "Jane" )<br />then<br /> ...<br /><br /><br />><br />> Thanks<br />> --------<br /><br /><br />------------------------------<br /><br />Message: 3<br />Date: Wed, 04 Apr 2012 13:54:19 +0100<br />From: Mark Proctor <mproctor@codehaus.org><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: <4F7C447B.7010504@codehaus.org><br />Content-Type: text/plain; charset="iso-8859-1"<br /><br />On 04/04/2012 12:32, muenchen@korgen.de wrote:<br />><br />> Hi Mark,<br />> Thanks for your reply, but the row in the drl the error occurs on is <br />> in an eval.what do you mean by explicit?<br />> anyway this does not explain why it runs on jdk1.6 but not on 1.7.<br />><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 "getting involved" 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 />><br />> Best<br />><br />> J?rg<br />><br />> sent from a mobile device<br />><br />> On Apr 4, 2012 12:55 PM, "Mark Proctor" <mproctor@codehaus.org <br />> <mailto:mproctor@codehaus.org <mproctor@codehaus.org>>> wrote:<br />><br />> On 04/04/2012 11:04, korgen wrote:<br />> > Hi folks,<br />> > In the process of upgrading from Java 1.6 to Java 1.7 (1.7.0_03<br />> to be<br />> > precise) we updated Drools from 5.1.1 to 5.3.1 (as in 5.1.1<br />> language level<br />> > 1.7 is not supported).<br />> ><br />> > However with Drools 5.3.1 the system property<br />> "drools.dialect.mvel.strict"<br />> > seems not to be applied all the time. I know this sounds fishy,<br />> but this is<br />> > the behaviour:<br />> MVEL strictness is only applied to explicite eval, consequence, return<br />> values and accumulates.<br />><br />> It's not applied to field constaints. We foudn some points, around<br />> collections, where type safeness for constraints is not enforced and<br />> have strengthened that. You can still get type unsafe execution, by<br />> using the typesfalse(false), for the specific pattern. We don't<br />> like to<br />> encourage lack of type safety, as it creates difficult to maintain<br />> systems and will not benefit from performance enhancements we do on<br />> bytecode generation.<br />><br />> Mark<br />> ><br />> > In a (junit based) test we create the knowledgebase by loading<br />> multiple drl<br />> > files. Each of them has the dialect 'mvel' set in its beginning.<br />> > In our @BeforeClass of the test we do a:<br />> > System.setProperty("drools.dialect.mvel.strict", "false");<br />> ><br />> > and I also tried using a KnowledgeBuilderConfiguration with the<br />> appropriate<br />> > settings.<br />> > But still sometimes the test fails with a "unable to resolve<br />> method using<br />> > strict-mode..." message. I say sometime because running the test<br />> multiple<br />> > times via maven "mvn -Dtest=ClassicDroolsTest test" sometimes<br />> produces<br />> > failure, sometimes produces success.<br />> > It might by noteworthy that the method called in the test<br />> expects two<br />> > parameters of type Double, but as it seems Drools is not seeing the<br />> > covariant return type of the class which is actually used (the<br />> abstract base<br />> > method has return type Object, the concrete method has return<br />> type Double).<br />> ><br />> > I tried to reproduce the issue with a simpler test setup to be<br />> able to post<br />> > it here but did not succeed.<br />> ><br />> > I also applied the patch<br />> ><br />> <a href="https://github.com/droolsjbpm/drools/commit/1c20018abeef8bee86f896ffff7945404cebb18f" target="_blank">https://github.com/droolsjbpm/drools/commit/1c20018abeef8bee86f896ffff7945404cebb18f</a><br />> > (comming from <a href="https://issues.jboss.org/browse/JBRULES-3163%29" target="_blank">https://issues.jboss.org/browse/JBRULES-3163)</a> to<br />> the Drools<br />> > 5.1.1 sources, compiled them myself and everything works like a<br />> charm with<br />> > it. However I cannot use this unofficial work around as I can't<br />> (and don't<br />> > want) use a patched version of Drools in my environment.<br />> > Also when I compile& run my sources with jdk 1.6.0_31<br />> everything is fine.<br />> ><br />> > I'd really appreciate any help on this topic as I couldn't find<br />> any hints on<br />> > this behaviour in the release notes from Drools versions> 5.1.1<br />> ><br />> > Thanks<br />> ><br />> > Joerg<br />> ><br />> > --<br />> > View this message in context:<br />> <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 />> > Sent from the Drools: User forum mailing list archive at Nabble.com.<br />> > _______________________________________________<br />> > rules-users mailing list<br />> > rules-users@lists.jboss.org <mailto:rules-users@lists.jboss.org <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 />> rules-users mailing list<br />> rules-users@lists.jboss.org <mailto:rules-users@lists.jboss.org <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 />><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 />-------------- 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 <wolfgang.laun@gmail.com><br />Subject: Re: [rules-users] mvel strict-mode not applied in drools<br />        5.3.1.Final<br />To: Rules Users List <rules-users@lists.jboss.org><br />Message-ID:<br />        <CANaj1LfVJpE+s3VZgfX-yh9KupZ8t61NzPG_mCpc_UKKAiLPxA@mail.gmail.com><br />Content-Type: text/plain; charset=ISO-8859-1<br /><br />@J?rg:<br /><br />>> On 04/04/2012 11:04, korgen wrote:<br />>> we updated Drools from 5.1.1 to 5.3.1 (as in 5.1.1<br />>> language level<br />>> > 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 <mproctor@codehaus.org><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: <4F7C4BCA.60809@codehaus.org><br />Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br /><br />On 04/04/2012 14:23, Wolfgang Laun wrote:<br />> @J?rg:<br />><br />>>> On 04/04/2012 11:04, korgen wrote:<br />>>> we updated Drools from 5.1.1 to 5.3.1 (as in 5.1.1<br />>>> language level<br />>>> > 1.7 is not supported).<br />> Why would Drools 5.1.1. not be usable with Java 1.7? Byte code is<br />> 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 />><br />> -W<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 /><br />------------------------------<br /><br />Message: 6<br />Date: Wed, 4 Apr 2012 07:12:47 -0700 (PDT)<br />From: albertorugnone <arugnonechemical@gmail.com><br />Subject: Re: [rules-users] KnowledgeAgent Changeset problems<br />To: rules-users@lists.jboss.org<br />Message-ID: <1333548767225-3884201.post@n3.nabble.com><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 "incremental build of<br />KnowledgeBase finished and in use" 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("START");<br />         String xml = "";<br />         xml += "<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'";</a><br />         xml += " <br />xmlns:xs='<a href="http://www.w3.org/2001/XMLSchema-instance%27%22;" target="_blank">http://www.w3.org/2001/XMLSchema-instance'";</a><br />         xml += " <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' >";<br />         xml += " <add> ";<br />         xml += " <resource source='Z:/EXP/drools-test/knowledge/test.drl'<br />type='DRL' />";<br />         xml += " </add> ";<br />         xml += "</change-set>";<br />         FileManager fileManager = new FileManager();<br />         File fxml = fileManager.newFile("changeset.xml");<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("drools.resource.scanner.interval", "2");<br />         ResourceFactory.getResourceChangeScannerService()<br />         .configure(sconf);<br /><br />         final KnowledgeAgentConfiguration aconf =<br />KnowledgeAgentFactory.newKnowledgeAgentConfiguration();<br />         aconf.setProperty("drools.agent.scanDirectories", "true");<br />         aconf.setProperty("drools.agent.scanResources", "true");<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("drools.agent.newInstance", "false");<br />         final KnowledgeAgent agent =<br />KnowledgeAgentFactory.newKnowledgeAgent("pch.sel.knowledge.agent", aconf);<br />         // if (_l.isDebugEnabled()) {<br />         /* we need some log every time */<br />         agent.setSystemEventListener(new PrintStreamSystemEventListener());<br />        <br />agent.applyChangeSet(ResourceFactory.newClassPathResource("pch.sel.kwset.xml"));<br />         // fire rules<br />         StatefulKnowledgeSession session =<br />agent.getKnowledgeBase().newStatefulKnowledgeSession();<br />         session.fireAllRules();<br />         _l.warn("END");<br /><br /><br />and here the rule<br /><br /><br />package it.ipiu.drools.KnowledgeAgent.test<br /><br />rule "test rule" timer(int: 0s 2s)<br /> when<br /> eval(true);<br /> then<br /> System.out.println("ciao");<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>