[rules-users] setting Agenda group programmatically

Edson Tirelli ed.tirelli at gmail.com
Fri Jan 29 15:32:38 EST 2010


      The "lifecycle" of drools assets, from source to executable ReteOO,
can be represented by the following workflow:

Source Code -> Descr Model -> Knowledge Model -> ReteOO (kbase)

     Explaining:

1. The source code (DRL, Decision Table, BRXML, etc) goes through the drools
parser that generates the descriptor model. The descriptor model is a
canonical text-based model of your assets (packages, rules, etc). You may
think about it as an Abstract Syntax Tree, but without parser specific info.

2. The descriptor model goes through the knowledge builder and generates the
knowledge model. The knowledge model is a 1-to-1 mapping from the descr
model, but in binary (compiled) format.

3. The knowledge model goes through the reteoo builder to build the actual
ReteOO network, that ultimately is the executable format.

     Steps 1 and 2 are hidden behind a higher level API on the
KnowledgeBuilder, but you can easily execute the parser directly. Step 3
happens when you call KnowledgeBase.add().

     Some people like to tinker with the source rules by just generating,
changing, or injecting data into the Descr Model, instead of doing it in the
textual source code. As long as you are aware that those are internal APIs
that might change between drools versions and you are willing to maintain
any code you write based on that, it is an easy way of avoiding parsing the
rules source code yourself or using templates to inject the data you want.

    []s
    Edson



2010/1/29 Pritham <infinity2heaven at gmail.com>

>
>
> Edson Tirelli-4 wrote:
> >
> >     You could do this by either post-processing the DRL rule at
> deployment
> > time and injecting the attribute value,
> >
>
> I did exactly that to get mine working the way I want.
>
> However, I'm curious what you mean by,
>
> y using drools parser to generate the descriptor model, populate the
> attribute in the descriptor model and then deploy
>
> Could you pl expand on that?
> --
> View this message in context:
> http://n3.nabble.com/setting-Agenda-group-programmatically-tp142726p144052.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100129/72faeeb8/attachment.html 


More information about the rules-users mailing list