<br> Jojan,<br><br> Yes, as I mentioned, it is a JAVA block. What you can do in java, you can do in RHS... what you can't do in java, you can't do there.<br><br> Although, we are adding MVEL support to version
4.0, where you can use it instead of java. MVEL has a lot of syntax simplifications to help with such cases.<br><br> []s<br> Edson<br><br><br><div><span class="gmail_quote">2007/6/7, Joj <<a href="mailto:jojpm@yahoo.com">
jojpm@yahoo.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>But I believe tht thr ll be pbms if v try 2 simply operate on fields if
<br>their types r wrapper objects..<br>For e.x:<br>If the marks were Double, v cant simply write as :<br>student.setTotal( mark1 + mark2 );<br><br>instead, v have 2 write as :<br>student.setTotal( Double.valueOf( Double.parseDouble
("23") +<br>Double.parseDouble("18") ) );<br><br>where 23 and 18 are String values representing mark1 and mark2.<br><br>Or, is there any simpler way 2 do this, to operate on wrapper objects?<br><br>Thanks in advance,
<br>Jojan P.M.<br><br><br><br>Edson Tirelli-3 wrote:<br>><br>> RHS is a java block, anything valid in java is valid there... are you<br>> sure you are binding the variables?<br>><br>> when<br>> student : Student( mark1 : mark1, mark2 : mark2 )
<br>> then<br>> student.setTotal( mark1 + mark2 );<br>> end<br>><br>> []s<br>> Edson<br>><br>> 2007/6/1, Joj <<a href="mailto:jojpm@yahoo.com">jojpm@yahoo.com</a>>:<br>>><br>>>
<br>>> Hi,<br>>><br>>> Can't we write on RHS like:<br>>><br>>> student.setTotal(mark1 + mark2);<br>>> (where mark1 & 2 are variables in student)<br>>><br>>> Is it possible? I mean arithmetical operations, calling Java methods, etc
<br>>> from inside setters. If not, is there any other logic to do the same?<br>>><br>>><br>>> Please reply A.F.A.P.<br>>> Jojan<br>>><br>>> --<br>>> View this message in context:
<br>>> <a href="http://www.nabble.com/Setting-object%27s-fields-to-complex-result-in-RHS-tf3851977.html#a10911851">http://www.nabble.com/Setting-object%27s-fields-to-complex-result-in-RHS-tf3851977.html#a10911851</a>
<br>>> Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>>><br>>> _______________________________________________<br>>> rules-users mailing list<br>
>> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
>><br>><br>><br>><br>> --<br>> Edson Tirelli<br>> Software Engineer - JBoss Rules Core Developer<br>> Office: +55 11 3529-6000<br>> Mobile: +55 11 9287-5646<br>> JBoss, a division of Red Hat @
<a href="http://www.jboss.com">www.jboss.com</a><br>><br>> _______________________________________________<br>> rules-users mailing list<br>> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</a><br>> <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>><br>><br><br>--<br>View this message in context: <a href="http://www.nabble.com/Setting-object%27s-fields-to-complex-result-in-RHS-tf3851977.html#a11003397">
http://www.nabble.com/Setting-object%27s-fields-to-complex-result-in-RHS-tf3851977.html#a11003397</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br><br>_______________________________________________
<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @
<a href="http://www.jboss.com">www.jboss.com</a>