[rules-users] Possible to use functions in DRL when dialect is mvel?

Wolfgang Laun wolfgang.laun at gmail.com
Tue Jun 19 07:27:36 EDT 2012


Can you please provide an example where and how you import and use a
DRL function so that it works/doesn't work with MVEL/Java?

-W


On 19/06/2012, Stephen Masters <stephen.masters at me.com> wrote:
> Hi folks,
>
> Is it possible to refer to DRL functions from a DRL when the dialect is
> mvel?
>
> I have been working on unit tests for a rule that were consistently failing
> due to not being able to find the function that should be imported. Having
> tried various formats (the documentation is rather unhelpful here) for the
> import, I thought I'd see what happened if I just switched to the Java
> dialect. Suddenly it worked without even needing an import statement.
>
> Unfortunately, this forces me to switch from the neat ...
> newFact.Property = otherFact.Property
> ... to the rather ugly Java-style
> newFact.setProperty(otherFact.getProperty())
>
> So I would quite like to know if there is an undocumented (or
> well-hidden-documented) mechanism for using functions when in mvel dialect.
> Or am I stuck with switching to Java?
>
> Thanks in advance for any pointers anybody can provide,
>
> Steve


More information about the rules-users mailing list