[rules-users] Guvnor 5.1: Pencil icon not clickable in BRL editor
Scott Mayne
smayne at webfinancialsolutions.com
Thu Sep 23 12:13:35 EDT 2010
OK after jumping through some hoops to get development mode working, I found the problem. Class org.drools.guvnor.client.modeldriven.ui.ActionValueEditor has a method showTypeChoice(Widget w) which has a variable (FactPattern factPattern) used in an if-clause without a null check. The variable was coming back null and blowing up with a NPE, hence the icon didn't work.
I noticed things are uneven in the code regarding null-checks by callers of the function org.drools.ide.common.client.modeldriven.brl.RuleModel.getBoundFact(final String var) - might be something to look at.
--- On Fri, 9/17/10, Scott Mayne <smayne at webfinancialsolutions.com> wrote:
From: Scott Mayne <smayne at webfinancialsolutions.com>
Subject: [rules-users] Guvnor 5.1: Pencil icon not clickable in BRL editor
To: rules-users at lists.jboss.org
Date: Friday, September 17, 2010, 1:47 PM
Hi all,
I'm reading Paul
Browne's "JBoss Drools Business Rules" and in Ch. 5 we make a BRL in the guided
editor. We're using a simple fact model with a single class (Sales) which has
(among others) a field "sales", type long. The book uses an earlier version of
Guvnor so things look a little different but everything's worked so far, until I
use the editor to make a rule that looks like this in "view source":
rule
"SalesDiscount"
dialect "mvel"
when
mySales : Sales( salesValue
: sales >= "100" )
then
mySales.setSales( salesValue-10 );
update( mySales );
end
When I try it out, I get this line in the THEN
section
"1. Modify value of Sales [mySales] sales [pencil icon] [remove icon]
but neither "sales" nor the pencil icon is clickable, so I can't enter what it should change to. When click view source using what I could do I
get:
rule "SalesDiscount"
dialect "mvel"
when
mySales :
Sales( salesValue : sales >= "100" )
then
mySales.setSales(
);
mySales.setWait( );
update( mySales );
end
[I added
the "wait" because the modify field dropdown has this as an option but it's not
in the Java class and I'm not sure where it came from.]
Can anyone shed light on this behavior? I'm using the latest version of Firefox, compiling
with GWT/building my own EAR (though I haven't done any code changes) using RAD
7.5.5.1 (based on Eclipse 3.4), and am running Guvnor on
WebSphere.
-----Inline Attachment Follows-----
_______________________________________________
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/20100923/be7aba0f/attachment.html
More information about the rules-users
mailing list