I also have this requirement. I spoke to Michael Neale about it and he thought that it shouldn't be too difficult. Michael, I wasn't sure if you were going to add the feature request or if you want me to do it?<br>
<br>cheers<br>Steve<br><br><div class="gmail_quote">On Thu, Apr 10, 2008 at 9:30 AM, Brian Trezise <<a href="mailto:Brian.Trezise@intellidata.net">Brian.Trezise@intellidata.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="white" link="blue" vlink="purple" lang="EN-US">
<div>
<p><span style="color: rgb(31, 73, 125);">This is a feature request, or if
the feature already exists, a request that somebody let me know :)</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<p><span style="color: rgb(31, 73, 125);">I have a set of rules that
heavily depend on regular expressions to operate. The regular expression is
matched on the LHS of the rule, and then passed to another object for
additional processing in the RHS of the rule. We're looking at a
few hundred rules here. Here's the problem – because of
needing to use the regexes twice, I have stored them in a separate container
class as public static final String variables; however what we really want to
do is to be able to make a modification to either the regex or the rules
themselves, hot deploy the changes to the rule, and have everything work.
We specifically do not want to have to try hot-deploying or re-compiling
classes due to the potential issues that can arise. As it stands now it's
looking like we are going to have to endure a pretty heavy maintenance burden
by changing the rule, hot deploying, then later in the evening redeploying the
java code and rebooting the server whenever we make a change.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<p><span style="color: rgb(31, 73, 125);">The ideal solution for this
problem would be if we could set package-scoped variables in the .drl file,
outside of the rules. For example, at the top of the drl file, below the
import statements, if we could write something like the following:<br>
<br>
</span></p>
<p><span style="color: rgb(31, 73, 125);">let String THIS_STRING = "this
regular expression";</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<p><span style="color: rgb(31, 73, 125);">and then in the background when
the rule classes are generated, have them be declared as static final/constant
variables. This way they could be used on either side of the rule, but if
a change is made the RuleAgent will see that and overwrite the old version of
the rule package and fact processing would be able to continue uninterrupted.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<p><span style="color: rgb(31, 73, 125);">If anybody has any suggestions on
a work around, I would be appreciative.</span></p>
<p><span style="color: rgb(31, 73, 125);"> </span></p>
<p><span style="color: rgb(31, 73, 125);">Oh, and thanks to everybody for
helping me get the RuleAgent to work :)</span></p>
<div>
<p><b><span style="font-size: 10pt; color: gray;">___________________________________________________<br>
Brian Trezise<br>
Staff Software Engineer<br>
IntelliData, Inc<br>
</span></b><span style="font-size: 10pt; color: gray;">3173 s. uravan way<br>
aurora, colorado 80013<br>
T: 720.524.4864<br><font color="#888888">
<a href="mailto:brian.trezise@intellidata.net" target="_blank">brian.trezise@intellidata.net</a></font></span></p>
</div>
</div>
</div>
<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></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br><a href="mailto:steven.williams@objectconsulting.com.au">steven.williams@objectconsulting.com.au</a><br>
<a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br><br>consulting | development | training | support<br>our experience makes the difference