If you don't show your code we can't tell you what is wrong with it. So I think what you may have to do is<br><br>when<br> $someObj: SomeClass() # matches each WME of SomeClass<br> eval( $someObj.getValueBoolean("abc"))<br>
then<br><br>There is not much to be gained by using a DRL function; it would have to be called like<br> eval( someFunction( $someObj, "abc" ) )<br><br>-W<br><br><br><div class="gmail_quote">On 10 August 2011 11:05, Sumeet Karawal <span dir="ltr"><<a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi,<br>
<br>
I have a requirement where there is a customized Java class having a method<br>
that returns some value.<br>
like:<br>
<br>
getValueBoolean("Some String")<br>
<br>
{ //some calculation<br>
// returns a boolean value<br>
}<br>
<br>
The default getters and setters are not being used in the Application. The<br>
value that is being returned by the method needs to be checked in the .drl<br>
file.<br>
There are different Java classes with these kind of methods. Where the<br>
string and integer value is also returned. I have gone through the<br>
documentation for Drools-Expert but have only found the implementation for<br>
the method in the consequence part, i.e., the then part.<br>
<br>
This is how I tried:<br>
<br>
importing the class<br>
<br>
in when<br>
binding the a variable to the Class name suppose $c<br>
eval ($c.getValueBoolean("abc"))<br>
then<br>
System.out.println("the value is true")<br>
<br>
<br>
It didn't work this way.<br>
I tried by another way like :<br>
<br>
creating a function in the .drl itself that calls the method of that class<br>
and returns a value<br>
then calling this drl function in the when part and carrying on.<br>
<br>
It would be very helpful if some body could let me know how to do this in<br>
the .drl.<br>
<br>
<br>
Thanks & Regards,<br>
Sumeet Karawal<br>
Mailto: <a href="mailto:sumeet.karawal@tcs.com">sumeet.karawal@tcs.com</a><br>
<br>
=====-----=====-----=====<br>
Notice: The information contained in this e-mail<br>
message and/or attachments to it may contain<br>
confidential or privileged information. If you are<br>
not the intended recipient, any dissemination, use,<br>
review, distribution, printing or copying of the<br>
information contained in this e-mail message<br>
and/or attachments to it are strictly prohibited. If<br>
you have received this communication in error,<br>
please notify us by reply e-mail or telephone and<br>
immediately and permanently delete the message<br>
and any attachments. Thank you<br>
<br>
<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>