<div>Hi Felipe,</div>
<div> </div>
<div>When you define your LHS in the BRMS, there is an option to assign a variable to the expression. In the When part, there should be a little green triangle beside Person. Click on this to get a dialog called "Modify constraints for Person". At the bottom of this dialog is an option to set a variable name to bind to Person. Type p, or whatever you want into the text box and then click the Set button beside the text box. You should now have a LHS constraint of the form p:Person(...). Now create a Then action by clicking the + at the RHS of the Then part. A dialog will appear called "Add a new action". The first two option allows you to pick the variable p you just created - you probably want the second option of "modify a fact" as you want to call update(p) after modifying p. You should now see something like Set [p] in the Then part. Click on the Green triangle above Set [p] and you will get a dialog called "Add a field" with a list of the fields in the Person class. Choose the one you want to set (approvedMount?). What this does is actually call the method called setApprovedMount (Press View Source button to see). The Set action should now have a text box where you can enter the parameter $income *
1.2.</div>
<div> </div>
<div>I've had a look at the source code for this functionality and it only allows Setter methods to be called - unfortunately you cannot call any other methods on Person.</div>
<div> </div>
<div>Regards</div>
<div>Shahad</div>
<div><br><br> </div>
<div><span class="gmail_quote">On 10/3/07, <b class="gmail_sendername">Felipe Piccolini</b> <<a href="mailto:felipe.piccolini@bluesoft.cl">felipe.piccolini@bluesoft.cl</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="WORD-WRAP: break-word">
<div style="MARGIN: 0px">Ok, so to fit on the "not ignored emails" from the list Mark posted, I changed the title. However I following in the list </div>
<div style="MARGIN: 0px">anyways beacuse Im resending this email in less than 3 days. </div>
<div style="MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px">Note: Im not desperate, nor this is for today. This just came out today yesterday and well... its important to me, but I</div>
<div style="MARGIN: 0px">think I can get a work around for now.</div>
<div style="MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px">So here is the real on-topic question.</div>
<div style="MARGIN: 0px">-----------------</div>
<div style="MARGIN: 0px">Anyone knows how to use variables (from fields) setted on LHS, to modify a field on the RHS using the GUI editor</div>
<div style="MARGIN: 0px">from BRMS?</div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px">What I need is to write this rule on BRMS.</div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" color="#9a0000" size="3"><span style="FONT-SIZE: 11px">rule</span></font><font face="Monaco" size="3"><span style="FONT-SIZE: 11px"> </span></font><font face="Monaco" color="#008000" size="3">
<span style="FONT-SIZE: 11px">"Set approvedMount for a women"</span></font></div>
<div style="MARGIN: 0px"><span style="WHITE-SPACE: pre"></span><font face="Monaco" color="#9a0000" size="3"><span style="FONT-SIZE: 11px">no-loop</span></font><font face="Monaco" size="3"><span style="FONT-SIZE: 11px"> </span>
</font><font face="Monaco" color="#9a0000" size="3"><span style="FONT-SIZE: 11px">true</span></font></div>
<div style="MARGIN: 0px"><span style="WHITE-SPACE: pre"></span><font face="Monaco" color="#9a0000" size="3"><span style="FONT-SIZE: 11px">when</span></font></div>
<div style="MARGIN: 0px"><span style="WHITE-SPACE: pre"></span><span style="WHITE-SPACE: pre"></span><font face="Monaco" size="3"><span style="FONT-SIZE: 11px">$p: Person($sex: sex == </span></font><font face="Monaco" color="#008000" size="3">
<span style="FONT-SIZE: 11px">"F"</span></font><font face="Monaco" size="3"><span style="FONT-SIZE: 11px">, $income: incomeMount)</span></font></div>
<div style="MARGIN: 0px"><span style="WHITE-SPACE: pre"></span><font face="Monaco" color="#9a0000" size="3"><span style="FONT-SIZE: 11px">then</span></font></div>
<div style="MARGIN: 0px"><span style="WHITE-SPACE: pre"></span><span style="WHITE-SPACE: pre"></span><font face="Monaco" size="3"><span style="FONT-SIZE: 11px">$p.setApprovedMount($income * 1.2);</span></font></div>
<div style="MARGIN: 0px"><span style="WHITE-SPACE: pre"></span><span style="WHITE-SPACE: pre"></span><font face="Monaco" color="#9a0000" size="3"><span style="FONT-SIZE: 11px">update</span></font><font face="Monaco" size="3">
<span style="FONT-SIZE: 11px">($p);</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" color="#9a0000" size="3"><span style="FONT-SIZE: 11px">end</span></font></div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px">I know I can use formulas, but I only know how to set those on LHS, I dont know how to put a formula on RHS (setter of the field to modify).</div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px">Thanks.</div><br>
<div><span style="WORD-SPACING: 0px; FONT: 12px Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; border-spacing: 0px 0px">
<div><span style="TEXT-DECORATION: underline"><span> </span></span>
<div><font size="3"><span style="FONT-SIZE: 13px"><b style="FONT-WEIGHT: bold; FONT-SIZE: 13px"><span style="FONT-WEIGHT: bold; FONT-SIZE: 13px">Felipe Piccolini M.</span></b></span></font></div>
<div><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:felipe.piccolini@bluesoft.cl" target="_blank"><span style="COLOR: rgb(0,0,238)">felipe.piccolini@bluesoft.cl</span></a></div><br> </div>
<div><br> </div><br></span></div><br> </div><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br><br></blockquote></div><br>