<br>   What version of MVEL are you using?<br><br>   Edson<br><br><div class="gmail_quote">2010/1/13 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&#39;m getting some generic not-anything-saying error message:<br>
     [java] Unable to determine the used declarations.<br>
     [java] unexpected symbol &#39; &#39; : [Rule name=&#39;BL: Block mail domain&#39;]<br>
<br>
When I remove that concatenated matches expression (&quot;.*@&quot; +<br>
blacklistItemValue + &quot;.*&quot;) it compiles.<br>
<br>
Complete rule looks like:<br>
rule &quot;BL: Block mail domain&quot; ruleflow-group &quot;black-list&quot;<br>
salience 1001<br>
        when<br>
                not RejectionResult();<br>
<br>
                customer : CustomerPartyDRL();<br>
                blackList: BlacklistDRL();<br>
<div class="im"><br>
                onBlackList : ArrayList( size &gt; 0 )<br>
               from collect( BlacklistItemDRL( blacklistItemType matches<br>
&quot;MAIL_DOMAIN&quot; &amp;&amp; customer.currentContactInformation.partyEmailAddress.email<br>
matches blacklistItemValue )<br>
                             from blackList.getItems())<br>
</div>        then<br>
                auditLogger.addDeclineRule( &quot;BL: Block mail domain &quot; +<br>
<br>
customer.getCurrentContactInformation().getPartyEmailAddress().getEmailLowercase());<br>
<br>
                RejectionResult rejection = new OrderRejectionResult( );<br>
                rejection.setMessage(&quot;BL: Block mail domain &quot; +<br>
<br>
customer.getCurrentContactInformation().getPartyEmailAddress().getEmailLowercase());<br>
<br>
                insert( rejection  );<br>
<br>
end<br>
<br>
<br>
And fragment of the code I&#39;m using to compile rule package is:<br>
<br>
                Reader testSource = new<br>
InputStreamReader(RuleCompiler.class.getResourceAsStream(&quot;/perthTestRule.drl&quot;));<br>
                Reader sourceFlow = new<br>
InputStreamReader(RuleCompiler.class.getResourceAsStream(&quot;/perthScoreCustomerFlow.rf&quot;));<br>
<br>
                // add the package to a rulebase (deploy the rule package).<br>
                KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();<br>
                KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
<br>
                kbuilder.add(ResourceFactory.newReaderResource(testSource),<br>
ResourceType.DRL);<br>
                kbuilder.add(ResourceFactory.newReaderResource(sourceFlow),<br>
ResourceType.DRF);<br>
<br>
                System.out.println(kbuilder.getErrors().toString());<br>
<br>
                Collection&lt;KnowledgePackage&gt; pkgs = kbuilder.getKnowledgePackages();<br>
<br>
                try {<br>
                        kbase.addKnowledgePackages(pkgs);<br>
<br>
                        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();<br>
<br>
                        System.out.println(&quot;Knowladge session initialized...&quot;);<br>
                } catch (Exception e) {<br>
                        e.printStackTrace();<br>
<div><div></div><div class="h5">                }<br>
<br>
<br>
Edson Tirelli-4 wrote:<br>
&gt;<br>
&gt;    It should work... what error do you see?<br>
&gt;<br>
&gt;    Edson<br>
&gt;<br>
&gt; 2010/1/13 Lukas Svoboda &lt;<a href="mailto:lukasvoboda@googlemail.com">lukasvoboda@googlemail.com</a>&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; How can I get drools 5.0.1 compiled if I have regular expression matches<br>
&gt;&gt; part<br>
&gt;&gt; concat from static text + dynamic string?<br>
&gt;&gt;<br>
&gt;&gt; See example:<br>
&gt;&gt;                onBlackList : ArrayList( size &gt; 0 )<br>
&gt;&gt;               from collect( BlacklistItemDRL( blacklistItemType matches<br>
&gt;&gt; &quot;MAIL_DOMAIN&quot; &amp;&amp;<br>
&gt;&gt; customer.currentContactInformation.partyEmailAddress.email<br>
&gt;&gt; matches (&quot;.*@&quot; + blacklistItemValue + &quot;.*&quot;) )<br>
&gt;&gt;                             from blackList.getItems())<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Problem is when I&#39;m trying to do email matches (&quot;.*@&quot; +<br>
&gt;&gt; blacklistItemValue<br>
&gt;&gt; +<br>
&gt;&gt; &quot;.*&quot;), which worked in drools 4.0.7 but can&#39;t be compiled now in 5.0.1<br>
&gt;&gt;<br>
&gt;&gt; Is there any way how to use in matches part of reg exp dynamic property<br>
&gt;&gt; value plus static string?<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Lukas<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-tp119197p119197.html" target="_blank">http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p119197.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-tp119197p119353.html" target="_blank">http://n3.nabble.com/Drools-5-0-concat-string-in-matches-of-regular-expression-tp119197p119353.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>