[rules-dev] [rules-users] "factorize" rules

Edson Tirelli ed.tirelli at gmail.com
Tue Sep 25 15:55:59 EDT 2012


   This feature was developed by a community member. Looking at the code,
it seems it only inherits the LHS, not the attributes.

    Edson

On Tue, Sep 25, 2012 at 2:12 AM, Wolfgang Laun <wolfgang.laun at gmail.com>wrote:

> Moreover, in many cases I'd just not know what to write - not all the
> required details. In the case of "extends": how are basic and extended
> rule related to each other w.r.t. salience? How do rule attributes in
> base and extension relate to each other? Conflicts?
>
> -W
>
>
> On 25/09/2012, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:
> > Why isn't there just a small repository for the document(s)...
> >
> > On 24/09/2012, Mark Proctor <mproctor at codehaus.org> wrote:
> >>
> >> On 21 Sep 2012, at 06:29, Wolfgang Laun <wolfgang.laun at gmail.com>
> wrote:
> >>
> >>> @dev: When will "extends" for rules be documented in the proper place?
> >> documentation pull requests are welcome. The docs are large, so we are
> >> not
> >> always aware of what is and is not documented well, or in the right
> >> place.
> >> If you notice something, best thing to do is submit a pull request.
> >>
> http://docs.jboss.org/drools/release/5.4.0.Final/droolsjbpm-introduction-docs/html/gettingstarted.html
> >>
> >> Mark
> >>>
> >>> @John: There is a feature doing just that:
> >>>
> >>> rule pre_conditions_for_rules
> >>> when
> >>>   condition0
> >>> then end
> >>>
> >>> rule "Rule 1" extends pre_conditions_for_rules
> >>>   ruleflow-group "work"
> >>> when
> >>>  //...
> >>>
> >>> -W
> >>>
> >>> On 20/09/2012, John Dujon <johndujon at gmail.com> wrote:
> >>>> Hello,
> >>>>
> >>>> I am trying to make my rules more readable and wonder wether or not we
> >>>> can
> >>>> factorize rules for a particular ruleflow-group. As an example, I
> would
> >>>> like to convert this:
> >>>>
> >>>> // begin rules
> >>>> rule "Rule 1"
> >>>>     ruleflow-group "work"
> >>>> when
> >>>>  condition 0
> >>>>  condition1
> >>>> then
> >>>>  doSomething();
> >>>>
> >>>> rule "Rule 2"
> >>>>     ruleflow-group "work"
> >>>> when
> >>>>  condition0
> >>>>  condition2
> >>>> then
> >>>>  doSomethingElse();
> >>>>
> >>>> // end rules
> >>>>
> >>>> to the following
> >>>>
> >>>> // begin rules
> >>>>
> >>>> pre_conditions_for_rules
> >>>>  ruleflow-group "work"
> >>>>  condition0
> >>>>
> >>>> rule "Rule 1"
> >>>>     ruleflow-group "work"
> >>>> when
> >>>>  condition1
> >>>> then
> >>>>  doSomething();
> >>>> end
> >>>>
> >>>> rule "Rule 2"
> >>>>     ruleflow-group "work"
> >>>> when
> >>>>  condition2
> >>>> then
> >>>>  doSomethingElse();
> >>>> end
> >>>>
> >>>> // end rules
> >>>>
> >>>>
> >>>> Thank you for your time. I apologize in advance if that does not make
> >>>> sense, as I am new to drools
> >>>>
> >>>> John
> >>>>
> >>> _______________________________________________
> >>> rules-users mailing list
> >>> rules-users at lists.jboss.org
> >>> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >>
> >> _______________________________________________
> >> rules-dev mailing list
> >> rules-dev at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-dev
> >>
> >
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>



-- 
  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-dev/attachments/20120925/9d65c231/attachment.html 


More information about the rules-dev mailing list