<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Krishna Satya wrote:
<blockquote
cite="mid:bbd4d5d80712120710t2a72f8d7m829217788fb1ddba@mail.gmail.com"
type="cite">Hi, I am a new user to Drools and having passed the first
few days of reading and experimenting with the tool I am now looking to
see how rule parameters can be externalized. And along those lines
looking for patterns and best practices. I have searched through the
user forums (maybe not submitting the right search critera) and through
samples etc. <br>
<br>
My query is from my intent that application should be decoupled from
rules and the rules are decoupled from its parameters.<br>
<br>
I am wondering if Decision tables is the recommended approach or
externalizing/sourcing from Db recommended. Does the Business Service
that interacts with the rule engine source the rule parameters and push
it into working memory for the rule to pickup...or should the rule
declaration be tightly coupled to its parameters.
<br>
<br>
For example (Quick Psudo code, not sure if I have made any syntactical
errors):<br>
<br>
rule "Fee Waive Rule"<br>
when<br>
clientRequest : Request(account.balance > 2000 )<br>
then<br>
clientRequest.setFee(0);<br>
end<br>
<br>
rule "Fee Apply Rule"<br>
when<br>
clientRequest : Request(account.balance < 2000 )<br>
then<br>
clientRequest.setFee(5);<br>
end<br>
<br>
In the example above what are the best ways to externalize and make
available to the rule the account balance and fee parameters?
<br>
</blockquote>
Create web based forms that generate the rules on save, use something
like MVEL for rule generation. I also recommend you flatten your
objects, using account.balance foeld a field constraint is not optimal.<br>
<blockquote
cite="mid:bbd4d5d80712120710t2a72f8d7m829217788fb1ddba@mail.gmail.com"
type="cite"><br>
Any guidance on patterns/best practices/examples would be much
appreciated.<br>
<br>
Regards.<br>
- Krishna<br>
<br>
<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>