use of org.openforis.idm.metamodel.IdmInterpretationError in project collect by openforis.
the class ComparisonCheck method evaluate.
@Override
public ValidationResultFlag evaluate(Attribute<?, ?> node) {
Record record = node.getRecord();
SurveyContext recordContext = record.getSurveyContext();
ExpressionEvaluator expressionEvaluator = recordContext.getExpressionEvaluator();
String expr = getExpression();
try {
boolean valid = expressionEvaluator.evaluateBoolean(node.getParent(), node, expr, true);
return ValidationResultFlag.valueOf(valid, this.getFlag());
} catch (InvalidExpressionException e) {
throw new IdmInterpretationError("Error evaluating comparison check", e);
}
}
Aggregations