0
정적 필드가있는 클래스를 정의했으며 규칙의 왼쪽 필드에 액세스하고 싶습니다. 가능한가?LHS의 정적 필드에 액세스
package cep.model;
public class Events {
public static final int A = 1;
public static final int B = 2;
public static int getA() {
return A;
}
public static int getB() {
return B;
}
}
및 규칙 :
package cep.drl;
dialect "mvel"
import cep.Event;
import cep.model.Events;
declare Event
@role(event)
@expires(20s)
end
//A & B
rule "r001"
no-loop
when
$a : Event(typeId == Events.A)
and $b : Event(typeId == Events.B)
then
end
및 컴파일 사용이 샘 후
이 플러그인 :Unable to Analyse Expression typeId == Events.A:
[Error: unable to resolve method using strict-mode: cep$Event.Events()]
[Near : {... typeId == Events.A ....}]
^
[Line: 15, Column: 4] : [Rule name='r001']
Unable to Analyse Expression typeId == Events.B:
[Error: unable to resolve method using strict-mode: cep$Event.Events()]
[Near : {... typeId == Events.B ....}]
^
[Line: 16, Column: 8] : [Rule name='r001']