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