<!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">
Aeinehchi,<br>
<br>
If you want to go this route you'll have to learn how the system works.
First write some basic DRLS, then use the DrlParser to build a
PackageDescr. PackageDescr is an intermediate AST that represent your
rules with String for all the values. PackageBuilder can then build
those PackageDescr. However I would still recommend you generate drls
at runtime, with reflection on field names you can still achieve some
level of refactoring.<br>
<br>
Mark<br>
Aeinehchi Nader wrote:
<blockquote
 cite="mid:65F7363478F2E4459C058C8EB68A856F10C597@EDBCL03EX002.EDB.local"
 type="cite">
  <pre wrap="">I would very much like to wire my application with the rule engine.  By doing this, I would benefit from compiler, refactoring,....  Let me an example:

Car car = new Car();
car.setSpeed(100);


Fact requirement = new Fact(car.getSpeed() &gt; 120);

if (requirement){
Rule rule = new Rule(car.isOverspeeding(true));
}

How does the above fit to DRL?  Can this be done in compile-time with DRL?  Or can it be done by using Drools API?

Thanks.


Vennlig hilsen/Best regards
Nader Aeinehchi
Sjefsarkitekt /Chief Architect 
EDB Business Partner Norge AS
Telefon: +47 22 52 80 80, Direkte + 47 23 32 02 88, mobil: +47 41 44 29 57
E-post: <a class="moz-txt-link-abbreviated" href="mailto:nader@edb.com">nader@edb.com</a>
<a class="moz-txt-link-freetext" href="http://www.edb.com">http://www.edb.com</a> 
"EDB - En sterk og n&aelig;r IT-partner"



-----Opprinnelig melding-----
Fra: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> p&aring; vegne av Mark Proctor
Sendt: l&oslash; 3/3/2007 2:48
Til: Rules Users List
Emne: Re: [rules-users] Writing rules using java..
 
Just generate a drl from your model using a template langauge such 
velocity, freemarker or stringtemplate. you can generate and load the 
drl at runtime, this is what the decision table does. You can program 
agains the API yourself, but its quite complex, and certainly not 
recommended for a noobie.

Mark
Kolla, Sandeep wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi Rahul,

Its not about storing the whole file into the database.

I would have a Table representing the parameteres required to 
construct a rule.

For example.

Tables:

*RuleSetTable:*
Ruleset_id
Ruleset_name

*RuleTable:*
Rule_id
Rule_name
Rule_saliance
Rule_condition
Rule_consequence
Ruleset_id

Now while loading the rules the application basically should read from 
the DB, and construct the rules, as everything required to construct 
the rules is avaliable in the tables.

This requirement had come up because as the rules keep changing quite 
frequently, we don't want to bring down the application to load a new 
DRL file.

Hope you understood what I want to achieve.

Thanks much,
Sandeep.



------------------------------------------------------------------------

_______________________________________________
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>
  <pre wrap=""><!---->

  </pre>
  <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>