my problem is, that the ‚key‘ after the method getContentValue() is looking for, has to be variable and can be set by the rule creator.

I guess it remains the same problem whether I use DSL, Decision Table or any other construct to specify a Rule.

It is simply necessary, that the user (actually NOT an IT-Expert) would be guided through the possibilities a fact object supports.

If he cannot find the method getContentValue() he had to know its existence and arguments from elsewhere.


That’s why I’m curious whether it is possible (probably by using Java annotations or what else?) to tell the guided editor that it should also present some methods (not only fields according to the Java-Beans convention) to the user.

Thank you for the DSL hint. I will have a closer look at this approach anyway…  In my case it should probably looks like:

[when]There is a document which has a value keyed by {key} that matches {expr}=$: Dokument(….


Regards - Hans


Von: [] Im Auftrag von Stephen Masters
Gesendet: Montag, 10. Juni 2013 16:01
An: Rules Users List
Betreff: Re: [rules-users] choose method from fact object in guided editor


Is there some reason you can't just create a no-args method on the fact such as "getReviewedContent()"? Or why the pattern match couldn't directly match on reviewed content instead of using rules in Java to determine whether content has been reviewed?


If you don't want to do either of those, how about a DSL sentence to select reviewed content? i.e. 


[when][]There is a document which was reviewed by {reviewer}=$d: Document(getContentValue("reviewed") matches "{reviewer}"); Document(this == …


(warning - probable syntax errors above)







On 10 Jun 2013, at 13:58, Hans Wirz <> wrote:


I’m new to Drools and Guvnor and I’m trying to find a way to enable the selection of a method (other than getter and setter) by the guvnor guided editor in a drop-down-list way like the fields.


Example (.drl-file edited by Drools-Plugin in Eclipse):




How to achieve this in Guvnor guided editor, because the method getContentValue(“reviewed”) cannot be chosen – it must be KNOWN by the one who creates the rule?


My approach (using a Formula):




Many thanks for your help


rules-users mailing list