[rules-users] How to define Enum in the decision table

wyf wuyf at neusoft.com
Fri Nov 9 19:47:58 EST 2007


hi all:
    In my tests of the 4.0.3,How can I define java1.5 Enum In the Excel decision table as a condition?

I have a enum like this:
public enum JobStatus {
	UNEMPLOYED,EMPLOYED,RETIRED
}

I know i have to get a rule like this:

rule "EMPLOYED test"
	no-loop true
when
	    $moneys:List()
		$person:Person(jobstatus == JobStatus.EMPLOYED)	    
	then
		System.out.println( "EMPLOYED"+$person.getName()); 
		$moneys.add(new Money(2));
		retract($person);
end

I have Tryed define condition like JobStatus.EMPLOYED, EMPLOYED,"EMPLOYED", but nothing work!

I found JobStatus.EMPLOYED was convert to  
    $person:Person(jobstatus == "JobStatus.EMPLOYED")
buy the SpreadsheetCompiler

So, I Guess the decision table does not support java1.5 Enum??	    

thanks for any information

tobato




----------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Group Ltd., its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful. If you have received this communication in error, please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. 
-----------------------------------------------------------------------------------------------




More information about the rules-users mailing list