[rules-users] Questions concerning Java and rules / Flexibility

Esteban Aliverti esteban.aliverti at gmail.com
Thu Feb 3 12:52:11 EST 2011


Hi,

1) You write a java program, rules / actions are hard coded inline or saved
in text files / excel sheets / XML files etc. After importing the necessary
drools classes you call the drools interface routines, with the following
functionalities:
load rules, providing working memory, adding facts und finally starting the
rule
engine (e.g. firing rules).

Just some corrections here. The steps would be: load rules, get a working
memory (kbase), create a session from the working memory, insert facts to it
(this will start the pattern matching algorithm), fire the action part of
the rules that matches the inserted Facts.


2) You use the capabilities of the Drools GUI tools (such as Guvnor), which
allows entering rules, objects and actions via GUI tools.
Here, I don't get the point whether a part of the java code is generated
automatically, or whether you have to write your java classes by yourself,
as
presented in possibility 1 (above), but without coding the rules by yourself
in
the source code / external input files.

Guvnor is just used as a centralized place to create (if you want to),
maintain and distribute your rules. You have different editor for different
representations, like DRL, BRL (using a Guided Editor), Decision Table, DSL,
etc. Guvnor then exposes these assets (their source code or binary
representation) through different URLs. So, your application should read the
rules (in the first step of the previous section) from Guvnor using HTTP (or
even webdav) to create the working memory.

Hope this helps to clarify a little bit your thoughts.

Best Regards,


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Thu, Feb 3, 2011 at 2:26 PM, Martin Richardsen <jaichwill at gmail.com>wrote:

>
> I am a complete novice concerning Drools and have some basic questions,
> which arised after studying the drools documentation and some examples as
> well.
>
> As far as I got it right, you have two possibilities to work with drools
>
> 1) You write a java program, rules / actions are hard coded inline or saved
> in text files / excel sheets / XML files etc. After importing the necessary
> drools classes you call the drools interface routines, with the following
> functionalities:
> load rules, providing working memory, adding facts und finally starting the
> rule
> engine (e.g. firing rules).
>
> 2) You use the capabilities of the Drools GUI tools (such as Guvnor), which
> allows entering rules, objects and actions via GUI tools.
> Here, I don't get the point whether a part of the java code is generated
> automatically, or whether you have to write your java classes by yourself,
> as
> presented in possibility 1 (above), but without coding the rules by
> yourself in
> the source code / external input files.
>
> I would be very pleased, if anyone could explain me the essential
> difference
> between the two approaches and accordingly tell me what the advantage of
> using
> method 2) would be in contrast to method 1), particularly concerning the
> necessary java coding.
>
>
> ---
>
>
> Well and there would be another question, if you write down your rules and
> the
> corresponding software, which accesses the rules, is it possible to add
> some
> rules later, without rewriting/recompiling your software?
>
>
> Thanks in advance!
>
> Cheers, Martin.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110203/79641de9/attachment.html 


More information about the rules-users mailing list