generic properties

View: New views
2 Messages — Rating Filter:   Alert me  

generic properties

by thomas kukofka :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I want to use a generic Input-Object for drools which can i.g. access String properties:
 
    private HashMap<Parameter, String> stringParameter;

with methods:
public String getStringPropertyValue(Parameter parameter) {
        return stringParameter.get(parameter);
    }
   
    public void setStringPropertyValue(Parameter parameter, String value) {
        stringParameter.put(parameter, value);
    }


My problem is can I use in drl something like :

when
io: InputObject (getStringPropertyValue("propertyname") == "something")

regards
thomas

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users

Re: generic properties

by Vanina Beraudo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
you can try using "eval"


when

$io:InputObject()

eval($io.getStringPropertyValue("propertyname")=="something")

then
......................

2008/7/23 thomas kukofka <thomaskukofka@...>:

> Hello,
>
> I want to use a generic Input-Object for drools which can i.g. access String
> properties:
>
>     private HashMap<Parameter, String> stringParameter;
>
> with methods:
> public String getStringPropertyValue(Parameter parameter) {
>         return stringParameter.get(parameter);
>     }
>
>     public void setStringPropertyValue(Parameter parameter, String value) {
>         stringParameter.put(parameter, value);
>     }
>
>
> My problem is can I use in drl something like :
>
> when
> io: InputObject (getStringPropertyValue("propertyname") == "something")
>
> regards
> thomas
>
> _______________________________________________
> rules-users mailing list
> rules-users@...
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



--
Lic. Vanina Beraudo
_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users
LightInTheBox - Buy quality products at wholesale price