As my Evauator LHS is string , so I am setting STRING_TYPE in my Evaluator
definition class.
CodeEvaluator extends BaseEvaluator {
public CodeEvaluator() {
super( ValueType.STRING_TYPE,
D1Operator.COMPARE_CODE );
}
But if I use that operator with || then compiler pointed that it should be
OBJECT_TYPE.
And If changed my evaluator definition then its start working ok, but it
pointed error If I use that operator alone or with && hat it should be
STRING_TYPE
*Solution*
I remain it to STRING_TYPE in evaluator class.
But add that operator as both object & string in EvaluatorCache as follows:
addEvaluator( ValueType.STRING_TYPE,
D1Operator.COMPARE_CODE, CodeEvaluator.INSTANCE );
addEvaluator( ValueType.OBJECT_TYPE,
D1Operator.COMPARE_CODE, CodeEvaluator.INSTANCE );
--
View this message in context:
http://drools.46999.n3.nabble.com/Custom-Evaluator-compile-time-error-If-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.