OK. I tried here (admittedly with 5.2, but I don't believe we've changed the area in question much - if at all).
These are the steps I followed (which might highlight an additional step not clear in the book):- - <Complete up to step 5> - Click on the pencil icon (as you have done) - Select the "sales" field - The field "sales" will be shown with another pencil icon - Click on the "new" pencil icon and you are given the option of a literal value or a formula. - Choose formula.... Let me know if this helps? Thanks, Mike On 21 June 2011 11:05, marros <martin.ros...@vships.com> wrote: > 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. > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users >
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users