<br><br><div class="gmail_quote">2011/8/4 Gaurav Silakari <span dir="ltr">&lt;<a href="mailto:gaurav.silakari@tcs.com">gaurav.silakari@tcs.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div>Hi,</div><div> </div><div>I have some queries on Drools. These might be very basic but I need to get them cleared.</div><div> </div><div> <table width="500">
<tbody><tr><td>1) Is it possible to bind the constructor name of java class(provided in the &#39;import&#39; syntax) with a bind variable in LHS of the rule<br></td></tr></tbody></table></div></font></blockquote><div><br>
Whatever would you need the binding for? MyClass.class.getName() is also the constructor&#39;s name. <br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div><table width="500"><tbody><tr><td>2) Is it possible to call a parameterised (single parameter) method of a class (by giving class reference as bind variable and class being declared in &#39;import&#39; syntax ) in LHS of the rule<br>
</td></tr></tbody></table></div></font></blockquote><div><br>If the Class object is an attribute of some fact it can be bound and you can use<br>reflection to call the method. This could be written as a DRL function.<br><br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div><table width="500">
<tbody><tr><td>3) Is it possible to call a parameterised method (with single parameter) in the RHS of the rule (The method would be pertaining to the class imported in the &#39;import&#39; syntax and method name being invoked through the bind variable reference )</td>
</tr></tbody></table></div></font></blockquote><div><br>Assuming the method name (or the Method object) comes from a field in some fact, it can be bound to a variable. On the RHS you proceed as in Java.<br><br>-W<br></div>
</div>