<br>   Ok, thanks for checking. I just opened a ticket:<br><br><a href="http://jira.codehaus.org/browse/MVEL-200">http://jira.codehaus.org/browse/MVEL-200</a><br><br>   Meanwhile, what I can suggest is a workaround, adding a helper method to the BlacklistItemDRL that returns the pattern ready for use:<br>
<br>onBlackList : ArrayList( size &gt; 0 ) from collect( <br>       BlacklistItemDRL( blacklistItemType matches &quot;MAIL_DOMAIN&quot;,<br>                                  customer.currentContactInformation.partyEmailAddress.email<br>
<div id=":1hq" class="ii gt">                                  matches blacklistItemValuePattern )<br>                                  from blackList.getItems())<br>
</div><br>    As soon as MVEL is fixed, should be just a matter of updating the jar.<br><br>    Edson<br><br><br><div class="gmail_quote">2010/1/15 Lukas Svoboda <span dir="ltr">&lt;<a href="mailto:lukasvoboda@googlemail.com">lukasvoboda@googlemail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
I tried the latest MVELs 2.0.15 and 2.0.16 and no luck.<br>
<br>
The error message says now:<br>
<div class="im">     [java] Unable to determine the used declarations.<br>
</div>     [java] [Error: unexpected symbol &#39; &#39;]<br>
     [java] [Near : {... s.email ~= ( &quot;.*@&quot; + blacklist ....}]<br>
     [java]                       ^<br>
     [java] [Line: 1, Column: 61] : [Rule name=&#39;BL: Block mail domain&#39;]<br>
<div><div></div><div class="h5"><br>
<br>
<br>
Edson Tirelli-4 wrote:<br>
&gt;<br>
&gt;    The error message you reported means that MVEL could not properly parse<br>
&gt; this expression:<br>
&gt;<br>
&gt; &quot;.*@&quot; + blacklistItemValue + &quot;.*&quot;<br>
&gt;<br>
&gt;    What is obviously strange, but that is what the error message says.<br>
&gt;<br>
&gt;    Quick try is: download and replace the mvel jar you have (should be<br>
&gt; mvel<br>
&gt; version 2.0.10) by the newest one from here (2.0.15):<br>
&gt;<br>
&gt; <a href="http://mvel.codehaus.org/Downloading+MVEL" target="_blank">http://mvel.codehaus.org/Downloading+MVEL</a><br>
&gt;<br>
&gt;    I did not tested the new mvel for regressions, but you might get lucky.<br>
&gt; Otherwise, please open a jira against Drools adding your test case and we<br>
&gt; will make sure it gets fixed and updated.<br>
&gt;<br>
&gt;    Thanks,<br>
&gt;         Edson<br>
&gt;<br>
&gt; 2010/1/14 Lukas Svoboda &lt;<a href="mailto:lukasvoboda@googlemail.com">lukasvoboda@googlemail.com</a>&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m not sure whether mvel version matters for compilation of drools,<br>
&gt;&gt; anyway<br>
&gt;&gt; I&#39;m using mvel2.jar distributed in drools5.0.1-binaries.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m more suspicious whether it&#39;s related to compiler since it requires<br>
&gt;&gt; eclipse jdt (I&#39;m using org.eclipse.jdt.core_3.4.2.v_883_R34x.jar) unlike<br>
&gt;&gt; drools 4.0.7 I was using originally.<br>
&gt;&gt;<br>
&gt;&gt; Do I have to setup somehow KnowledgeBuilder by creating custom<br>
&gt;&gt; KnowledgeBuilderConfiguration.<br>
&gt;&gt;<br>
&gt;&gt; I assume default is java dialect with Eclipse compiler. Is it right?<br>
&gt;&gt;<br>
&gt;&gt; Lukas<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Edson Tirelli-4 wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;    What version of MVEL are you using?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;    Edson<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2010/1/13 Lukas Svoboda &lt;<a href="mailto:lukasvoboda@googlemail.com">lukasvoboda@googlemail.com</a>&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I&#39;m getting some generic not-anything-saying error message:<br>
&gt;&gt; &gt;&gt;     [java] Unable to determine the used declarations.<br>
&gt;&gt; &gt;&gt;     [java] unexpected symbol &#39; &#39; : [Rule name=&#39;BL: Block mail domain&#39;]<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; When I remove that concatenated matches expression (&quot;.*@&quot; +<br>
&gt;&gt; &gt;&gt; blacklistItemValue + &quot;.*&quot;) it compiles.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Complete rule looks like:<br>
&gt;&gt; &gt;&gt; rule &quot;BL: Block mail domain&quot; ruleflow-group &quot;black-list&quot;<br>
&gt;&gt; &gt;&gt; salience 1001<br>
&gt;&gt; &gt;&gt;        when<br>
&gt;&gt; &gt;&gt;                not RejectionResult();<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                customer : CustomerPartyDRL();<br>
&gt;&gt; &gt;&gt;                blackList: BlacklistDRL();<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                onBlackList : ArrayList( size &gt; 0 )<br>
&gt;&gt; &gt;&gt;               from collect( BlacklistItemDRL( blacklistItemType<br>
&gt;&gt; matches<br>
&gt;&gt; &gt;&gt; &quot;MAIL_DOMAIN&quot; &amp;&amp;<br>
&gt;&gt; &gt;&gt; customer.currentContactInformation.partyEmailAddress.email<br>
&gt;&gt; &gt;&gt; matches blacklistItemValue )<br>
&gt;&gt; &gt;&gt;                             from blackList.getItems())<br>
&gt;&gt; &gt;&gt;         then<br>
&gt;&gt; &gt;&gt;                auditLogger.addDeclineRule( &quot;BL: Block mail domain &quot; +<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; customer.getCurrentContactInformation().getPartyEmailAddress().getEmailLowercase());<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                RejectionResult rejection = new OrderRejectionResult(<br>
&gt;&gt; );<br>
&gt;&gt; &gt;&gt;                rejection.setMessage(&quot;BL: Block mail domain &quot; +<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; customer.getCurrentContactInformation().getPartyEmailAddress().getEmailLowercase());<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                insert( rejection  );<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; end<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; And fragment of the code I&#39;m using to compile rule package is:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                Reader testSource = new<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; InputStreamReader(RuleCompiler.class.getResourceAsStream(&quot;/perthTestRule.drl&quot;));<br>
&gt;&gt; &gt;&gt;                Reader sourceFlow = new<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; InputStreamReader(RuleCompiler.class.getResourceAsStream(&quot;/perthScoreCustomerFlow.rf&quot;));<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                // add the package to a rulebase (deploy the rule<br>
&gt;&gt; &gt;&gt; package).<br>
&gt;&gt; &gt;&gt;                KnowledgeBase kbase =<br>
&gt;&gt; &gt;&gt; KnowledgeBaseFactory.newKnowledgeBase();<br>
&gt;&gt; &gt;&gt;                KnowledgeBuilder kbuilder =<br>
&gt;&gt; &gt;&gt; KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; kbuilder.add(ResourceFactory.newReaderResource(testSource),<br>
&gt;&gt; &gt;&gt; ResourceType.DRL);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; kbuilder.add(ResourceFactory.newReaderResource(sourceFlow),<br>
&gt;&gt; &gt;&gt; ResourceType.DRF);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                System.out.println(kbuilder.getErrors().toString());<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                Collection&lt;KnowledgePackage&gt; pkgs =<br>
&gt;&gt; &gt;&gt; kbuilder.getKnowledgePackages();<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                try {<br>
&gt;&gt; &gt;&gt;                        kbase.addKnowledgePackages(pkgs);<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                        StatefulKnowledgeSession ksession =<br>
&gt;&gt; &gt;&gt; kbase.newStatefulKnowledgeSession();<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;                        System.out.println(&quot;Knowladge session<br>
&gt;&gt; &gt;&gt; initialized...&quot;);<br>
&gt;&gt; &gt;&gt;                } catch (Exception e) {<br>
&gt;&gt; &gt;&gt;                        e.printStackTrace();<br>
&gt;&gt; &gt;&gt;                 }<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Edson Tirelli-4 wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;    It should work... what error do you see?<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;    Edson<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 2010/1/13 Lukas Svoboda &lt;<a href="mailto:lukasvoboda@googlemail.com">lukasvoboda@googlemail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; How can I get drools 5.0.1 compiled if I have regular expression<br>
&gt;&gt; &gt;&gt; matches<br>
&gt;&gt; &gt;&gt; &gt;&gt; part<br>
&gt;&gt; &gt;&gt; &gt;&gt; concat from static text + dynamic string?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; See example:<br>
&gt;&gt; &gt;&gt; &gt;&gt;                onBlackList : ArrayList( size &gt; 0 )<br>
&gt;&gt; &gt;&gt; &gt;&gt;               from collect( BlacklistItemDRL( blacklistItemType<br>
&gt;&gt; &gt;&gt; matches<br>
&gt;&gt; &gt;&gt; &gt;&gt; &quot;MAIL_DOMAIN&quot; &amp;&amp;<br>
&gt;&gt; &gt;&gt; &gt;&gt; customer.currentContactInformation.partyEmailAddress.email<br>
&gt;&gt; &gt;&gt; &gt;&gt; matches (&quot;.*@&quot; + blacklistItemValue + &quot;.*&quot;) )<br>
&gt;&gt; &gt;&gt; &gt;&gt;                             from blackList.getItems())<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Problem is when I&#39;m trying to do email matches (&quot;.*@&quot; +<br>
&gt;&gt; &gt;&gt; &gt;&gt; blacklistItemValue<br>
&gt;&gt; &gt;&gt; &gt;&gt; +<br>
&gt;&gt; &gt;&gt; &gt;&gt; &quot;.*&quot;), which worked in drools 4.0.7 but can&#39;t be compiled now in<br>
&gt;&gt; 5.0.1<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Is there any way how to use in matches part of reg exp dynamic<br>
&gt;&gt; &gt;&gt; property<br>
&gt;&gt; &gt;&gt; &gt;&gt; value plus static string?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Thanks,<br>
&gt;&gt; &gt;&gt; &gt;&gt; Lukas<br>
&gt;&gt; &gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt; View this message in context:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; <a href="http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p119197.html" target="_blank">http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p119197.html</a><br>

&gt;&gt; &gt;&gt; &gt;&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt;&gt; &gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt;&gt; rules-users mailing list<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; &gt;&gt; &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;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; --<br>
&gt;&gt; &gt;&gt; &gt;  Edson Tirelli<br>
&gt;&gt; &gt;&gt; &gt;  JBoss Drools Core Development<br>
&gt;&gt; &gt;&gt; &gt;  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt; rules-users mailing list<br>
&gt;&gt; &gt;&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; &gt;&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;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; View this message in context:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; <a href="http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p119353.html" target="_blank">http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p119353.html</a><br>

&gt;&gt; &gt;&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; rules-users mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; &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;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt;  Edson Tirelli<br>
&gt;&gt; &gt;  JBoss Drools Core Development<br>
&gt;&gt; &gt;  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; rules-users mailing list<br>
&gt;&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&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;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p120451.html" target="_blank">http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p120451.html</a><br>

&gt;&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><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;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;  Edson Tirelli<br>
&gt;  JBoss Drools Core Development<br>
&gt;  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><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>
<br>
--<br>
</div></div>View this message in context: <a href="http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p121944.html" target="_blank">http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p121944.html</a><br>

<div><div></div><div class="h5">Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>