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

Michael Anstis michael.anstis at gmail.com
Thu Feb 3 14:49:27 EST 2011


With regard to:-

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.

You can choose whether you want to upload a POJO Java model or declare one
within Guvnor itself (this feature is also available in DRL too - see
"declare" in the "Expert" documentation). Guvnor basically offers a
graphical means to (in reality) a sub-set of "drools" feature-set ("drools"
as in Drools Expert, Drools Fusion, Drols Flow - now jBPM5 - and Drools
Solver). Guvnor does offer some things of it's own (in addition to graphical
editing: testing services, centralised repository etc). However you choose
to use "drools" a domain Java model will be needed (POJOs, declarative DRL,
defined in Guvnor etc) and rules (DRL, DSL, decision tables etc) authored
(text files, Guvnor's guided editors etc): How and where is largely up to
you.

With kind regards,

Mike

2011/2/3 Mauricio Salatino <salaboy at gmail.com>

> I'm just wanna add some comments
>
> 2011/2/3 Esteban Aliverti <esteban.aliverti at gmail.com>
>
> 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.
>>
> The working memory is the knowledge session (not the kbase) where all your
> facts will live.
> The main advantage of this approach is to have the business rules / logic
> decoupled from your application and declarative expressed.
> Remember that the rule engine will not evaluate the rules in a sequential
> order (in contrast with IF and CASE statements) and the rule engine design
> was conceived thinking to handle huge amount of rules and the evaluation of
> these rules are optimized.
>
>
>
>>
>> 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
>>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
> --
>  - CTO @ http://www.plugtree.com
>  - MyJourney @ http://salaboy.wordpress.com
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
> _______________________________________________
> 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/6e646bef/attachment.html 


More information about the rules-users mailing list