[rules-users] enums

thomas kukofka thomaskukofka at web.de
Mon Jul 28 09:30:53 EDT 2008


Hi,

I tried this. No problem at all.
I can use enums also like this:
	    io: InputObject(type == InputObject.Parameter.PARAMETERNAME)
Only this causes the error:

        private HashMap<Parameter, String> stringParameters;

	public HashMap<Parameter, String> getStringParameters() {
		return stringParameters;
	}

	public void setStringParameters(HashMap<Parameter, String> stringParameters) {
		this.stringParameters = stringParameters;
	}
*
       io: InputObject (
stringParameters[InputObject.Parameter.ParameterName] ==*
*"something")  -**> Field/method 'InputObject' not found for class
'com.rules.InputObject'Rule
*>* Compilation error**
*
If I use String instead of Parameter it works again:
        private HashMap<String, String> stringParameters;

*       io: InputObject ( stringParameters["somestring"] ==* *"something") *

Thomas



*Scott Reed*
    sreed at avacoda.com
        <rules-users%40lists.jboss.org?Subject=%5Brules-users%5D%20enums&In-Reply-To=d8ac9d7f0807280443j5c9edd90u2112c0e05a3c375f%40mail.gmail.com>

    *Mon Jul 28 09:10:48 EDT 2008*

Try a simple rule that just checks for any InputObject to make sure you
have the class imported correctly.

Rule "x"
when
InputObject()
then
end

thomas kukofka wrote:
>* Hello,
*>*
*>* If have an input object Inputobject which contains an enum
Parameter which contains all allowed parameters of InputObject:
*>*
*>*
*>* The entries for the parameters are stored in a map:
*>* private HashMap<Parameter, String> stringParameters;
*>*
*>* If I try:
*>* io: InputObject ( stringParameters[InputObject.Parameter.ParameterName] ==
*>*
*>*
*>* "something")
*>*
*>* I got the error
*>* =>Field/method 'InputObject' not found for class 'com.rules.InputObject'Rule
*>* Compilation error
*>*
*>* Kind Regards
*>* Thomas*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080728/85c9b736/attachment.html 


More information about the rules-users mailing list