Hello,
I'd like to use enum in java 1.5 with drools.
I try that :
A message class :
package com.pv.rules.beans;
public class Message {
String payload;
Type type;
public enum Type {
XML;
}
public Message(){
this.type = Type.XML;
}
public Message(String payload){
this.type = Type.XML;
this.payload = payload;
};
public String getPayload(){
return payload;
}
public void setPayload(String payload){
this.payload = payload;
}
public Type getType(){
return type;
}
}
and in my drl :
rule "Contexte1"
when
msg : Message(type == "XML", payload : payload)
xpathEquals "/Root/aaaa" "bbbb"
xpathEquals "/Root/cccc" "dddd
then
Log : "Contexte 1 ************* : OK";
end
but I've this error :
Unable to resolve ObjectType 'Message' : [Rule name=Contexte1,
agendaGroup=MAIN, salience=0, no-loop=false]
Rule Compilation error : [Rule name=Contexte1, agendaGroup=MAIN,
salience=0, no-loop=false]
Do you have an idea?
Thanks :-)