<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Using 'from {x}.field' in DSL</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">I have the following Drools DSL "sentence":</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> [when]The field {field} in the module {module} contains value {value}=$a : {module} ( {field} != null)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> String( this.equalsIgnoreCase("{value}") ) from $a.{field}</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">where the `field` is a `Set` of Strings.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Now, if I have two of these</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">sentences in one rule</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">, it obviously won't work as the variable `$a` occurs twice. So I wanted to improve the rule to make the variable, well, variable:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> [when]The field {field} in the module {module} contains value {value} as {a}={a} : {module} ( {field} != null)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri"> String( this.equalsIgnoreCase("{value}") ) from {a}.{field}</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">This doesn't work, I can't use the part `{a}.`, that breaks.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">So, my questions are: Is there either a way to rewrite the rules or a way to allow the `{variable}.` notation to work? Alternatively, is there a `contains` operator which works case insensitive?</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Thanks in advance</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Dominik</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
</BODY>
</HTML>