Sriram,
 
 I think that the entire expression from eval should return a boolean value.So, 
if you use a function in your expression which return a value (primitive value 
or object value) is not a problem.
 
 You can use one of the accessors  functions of your bean objects : 
getCountryName() which I suppose will return a String value. You can test if 
this value if the one you want.  e.g. eval(instance_of_Country.getCountryName() 
== "Australia"). 
 
 Regards, Oana

sriram <[EMAIL PROTECTED]> wrote: Hi,
   
  I have the following queries regarding implementation using JBoss Rules.
   
  In the LHS part how does one make function calls? I understand that one can 
use the eval( function-call ). But this i guess is applicable to only those 
functions which have a boolean return type. Say i need to call methods which 
need not have a boolean return type in the LHS part, then how do i implement it?
   
  Sample Example
  Consider a business/data object "County" with attribute "countryName". 
Suppose i need to check if the countryName should match with a predefined name 
which will be picked up from the application database :-
   
  rule "DMC validation on chapter  value"
    when
        $country: DataModuleBusinessObject(chapter == Dao.getCountryName());
    then
        System.out.println("Country does not start with  A");
  end
   
  Here Dao.getCountryName() is the call to get countryName from database. This 
method would return a String value. The above rule does not seem to work.
   
  Please guide me and let me know how to solve this problem and any possible 
workarounds. Let me know if the following are possible -
  1. To make method calls which do not have a boolean return type.
  2. Should all method calls be presented inside eval() ?
   
  Thanks & Regards,
  Sriram
         

---------------------------------
  Find out what India is talking about on  - Yahoo! Answers India 
  Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW

 
---------------------------------
Sponsored Link

Get an Online or Campus degree - Associate's, Bachelor's, or Master's -in less 
than one year.

Reply via email to