[rules-users] Guvnor guided editor problem - "add more options"

marros martin.roscoe at vships.com
Tue Jun 21 06:05:05 EDT 2011


The book is the PAKT Publishing book JBoss Drools Business Rules by Paul
Browne.

Am using Drools 5.1 and Guvnor 5.0.0.SNAPSHOT 25673M

Using the guided editor to create a rule that states if a sale has a value
of over 100 then discount it by 10.

Have partly created a rule as exactly how the book says as follows:

1. Create a new rule and add a condition using a sales fact (This has been
done OK.)
2. When adding the first constraint, enter a variable name (mySales) (this
has been doen OK)
3. Select GREATER THAN OR EQUAL TO in the PLEASE CHOOSE drop-down box, and
use the pencil icon to enter the value (100) - (this has been done OK)
4. On the second line of the newly created rule, click on the green arrow
above SALES. An option to bind the actual sales total to a variable is
shown. In this dialog box, assign it to salesValue (this has been done OK)
5. In the guided editor, The Add new Action dialog box now has additonal
options. Click on the green + sign whcih is next to THEN to make these
options appear. In this dialog box choose to modify the mySales fact (This
has been done OK)

The next bit is the bit that I cannot get to work:

Back in the guided editor, click on the pencil icon and enter the formula
(=salesValue-10)

What happens is that when you click to add the formula - you do not get that
option, you only get an option to ADD A FIELD and it shows a list of
available fields

I have gone upt to step 5 and viewed the source which is as follows:

1.	rule "SalesDiscount"
2.	    no-loop true
3.	    dialect "mvel"
4.	    when
5.	        mySales : Sales( salesvalues : sales >= "100" )
6.	    then
7.	        update( mySales );
8.	end


Which is as it should be up to step 5 (according to the book)

What it should look like after adding the formula is:

rule "SalesDiscount"
    no-loop true
    dialect "mvel"
    when
        mySales : Sales( salesvalues : sales >= "100" )
    then
        mySales:setSales( salesValue-10)
        update( mySales );
end

Hope this explains - I am also very new to Drools and trying to learn

Many Tanks

--
Best Regards

Marros

--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-guided-editor-problem-add-more-options-tp3087495p3090032.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list