[rules-users] calls to 'Helper' classes in LHS - are they allowed?

Michael Suzio msuzio at gmail.com
Mon Feb 12 16:33:08 EST 2007


The JBoss guys can correct me if I'm wrong, but although I think that works,
what you've just done is eliminate any chance to precompute matches and trim
down the checks that need to happen to find a rule match.  Since the engine
can't know that Helper.transform("value") returns a constant value, it has
to re-run that every time and it has to reject for matches to the rule
constraint every time.

I'm sure this would really sink performance, in other words.  You can easily
see the effect -- write the rule this way and time it, and then write it
with the return value of Helper.transform being inlined, and I'm sure
there's a big difference.  It's the same as any other eval(...) situation in
Drools; possible, but not good for performance.

On 2/12/07, Olenin, Vladimir (MOH) <Vladimir.Olenin at moh.gov.on.ca> wrote:
>
> Hi,
>
> I was wondering if calls to a Helper class are allowed in LHS of the rule?
> Eg:
>
> Rule myRule
> When
>         MyObject(objField == Helper.transform("value"))
> Then
>        // smth
> End
>
>
> Thanks,
>
> Vlad
> _______________________________________________
> 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/20070212/26536c97/attachment.html 


More information about the rules-users mailing list