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

Stephen Masters stephen.masters at me.com
Tue Jun 19 07:17:42 EDT 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120619/009068df/attachment-0001.html 


More information about the rules-users mailing list