[rules-users] execute Rules selectively
Michael Anstis
michael.anstis at gmail.com
Fri Mar 25 09:20:12 EDT 2011
You won't need to worry.
As the Fact A is inserted into Working Memory it is evaluated against all
rules.
Rules that match (i.e. your 3 of 1000) create activations on the Agenda that
are executed when you call fireAllRules.
Your "return" statements are possibly causing confusion; if your consequents
add validation errors to a list they can all be retrieved.
Cheers,
Mike
On 25 March 2011 13:10, Benson Fung <benson.redhat at gmail.com> wrote:
> Hi Leonardo,
>
> Thanks for your patience. Let me try to describe what I want in details.
>
> e.g. There is a variable A with 3 rules in BRMS.
>
> The variable A is input by a user via an edit box at the frontend.
> Now there are 1000 rules in the BRMS rulebase. However, 3 out of 1000
> rules are related to this variable A, like
>
> rule 'check_a_empty'
> when (( A == null) || (A == "") )
>
> then return a message 'A cannot be empty'
>
> rule 'A_Range_0_100'
> when ((A < 0 ) || (A > 100) )
>
> then return a message 'A must be within the range between 0 and 100'
>
> rule 'check_A_Character'
> when ((A is not an integer))
>
> return a message 'A must be an integer'
>
>
> If I would like to execute the above 3 rules at the same time, how to
> write/develop the AgendaFilter class?
>
> Please advise
>
>
> Thank you very much
> Benson
>
> 2011/3/25 Leonardo Gomes <leonardo.f.gomes at gmail.com>:
> > Hi Benson,
> >
> > What exactly do you want to achieve? You want to execute rules in
> parallel?
> >
> >
> >
> > On Fri, Mar 25, 2011 at 2:08 AM, Benson Fung <benson.redhat at gmail.com>
> > wrote:
> >>
> >> Hi,
> >>
> >> I have setup about 10 rules in the rulebase. Can you tell me how I
> >> can execute more than one specific rule at the same time? Please help
> >>
> >>
> >> Thanks
> >> Benson
> >> _______________________________________________
> >> 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
> >
> >
>
> _______________________________________________
> 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/20110325/ed6cbe0f/attachment.html
More information about the rules-users
mailing list