[rules-users] How to create a drl file or decision table dynamically?

Wolfgang Laun wolfgang.laun at gmail.com
Fri Feb 24 14:13:37 EST 2012


There is one (1) sentence and a dozen (12) lines of example in the
section about "What is New and Noteworhty in Drools 5.2.0" in the
Introduction manual. Given that this nano-documentation doesn't tell
you what to do with the resulting PackageDescr and that this "fluent
API" is part of the unstable API, I'd put my money on StringBuilder
and create rules as DRL text. YMMV.

-W


On 24/02/2012, Leonardo Gomes <leonardo.f.gomes at gmail.com> wrote:
> Hi Michael,
>
> Do you have a link to the Fluent API documentation? I wanted to answer to
> this question and couldn't find the link anywhere.
>
> Thanks,
> Leo.
>
> 2012/2/24 Michael Anstis <michael.anstis at gmail.com>
>
>> Yes.
>>
>> If the data "defines" the rules then there are numerous options:-
>>
>>    - Construct a DRL String yourself and pass this to a KnowledgeBuilder
>>    - Use the fluent API to build rules programmatically
>>    - Construct an XLS decision table using your favourite XLS (Java) API
>>    and look at drools-decisiontables
>>    - Construct a Guvnor decision table using classes in
>>    droolsjbpm-ide-common (bundled with Guvnor)
>>
>> If the data is to be plugged into place-holders in statically defined
>> rules:-
>>
>>    - Look at the use of Drools Expert Templates
>>
>> Decision tables do not lend themselves well to "OR" as there is an
>> implicit "AND" between columns.
>>
>> There might be other solutions, these are those that came readily to mind.
>>
>> With kind regards,
>>
>> Mike
>>
>>
>> On 24 February 2012 14:31, shawn <youngxiao121 at hotmail.com> wrote:
>>
>>> If it is possible to create a drl file or decision table dynamically in
>>> drool
>>> or java?
>>> Like the drool received data then create drl or decision table based on
>>> the
>>> data?
>>> Data: Condition 1 AND Condition 2 OR Condition 3 .....
>>> Can the above data be stored in the rule file which also contains the
>>> operators "AND", "OR"?
>>>
>>>
>>> --
>>> View this message in context:
>>> http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-table-dynamically-tp3772708p3772708.html
>>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>>> _______________________________________________
>>> 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
>>
>>
>



More information about the rules-users mailing list