[rules-users] Reusing predicates

Kris Nuttycombe kris.nuttycombe at gmail.com
Thu Jul 31 19:10:52 EDT 2008


Thanks; my primary concern was the code replication, so I'll go with
the intermediate fact approach.

Kris

On Thu, Jul 31, 2008 at 4:54 PM, Edson Tirelli <tirelli at post.com> wrote:
>
>    Not sure if you are worried about syntax or performance. If you are
> worried about performance, just write your common Patterns in the same order
> among your multiple rules and the engine will reuse them.
>
>    If you are worried about the syntax, i.e. not replicating the same code
> among multiple rules, the intermediate fact is probably the best solution
> right now. We want to implement rule inheritance or rule templates, but we
> don't have it yet.
>
>    []s
>    Edson
>
> 2008/7/31 Kris Nuttycombe <kris.nuttycombe at gmail.com>
>>
>> Hi, all,
>>
>> I have a set of rules where the LHS is essentially the same except for
>> a couple of additional conditions in each case. What is the best way
>> to factor out these common predicates? Should I simply create an
>> intermediate fact based upon the common set of conditions and then
>> reason with that fact, or is there a way of reusing them without
>> adding another fact to the mix?
>>
>> Thanks,
>>
>> Kris
>> _______________________________________________
>> 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, a division of Red Hat @ www.jboss.com
>
> _______________________________________________
> 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