[rules-users] choose method from fact object in guided editor

Hans Wirz hans.wirz at xmv.ch
Mon Jun 10 10:24:39 EDT 2013


Steve,

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: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] 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)

 

Steve

 

 

 

 

On 10 Jun 2013, at 13:58, Hans Wirz <hans.wirz at xmv.ch> wrote:





Hello

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):

 

<image001.png>

 

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):

<image002.png>

 

 

Many thanks for your help

Hans

_______________________________________________
rules-users mailing list
 <mailto:rules-users at lists.jboss.org> rules-users at lists.jboss.org
 <https://lists.jboss.org/mailman/listinfo/rules-users>
https://lists.jboss.org/mailman/listinfo/rules-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130610/ad107105/attachment.html 


More information about the rules-users mailing list