aviatorscript
aviatorscript copied to clipboard
addFunction success but when used "Function not found"
server start, AviatorEvaluator.addFunction(abstractFunction);
abstractFunction is my function.
when server run, has error: Function not found
@Component public class AviatorAddFunction {
private static final LOGGER LOGGER =LoggerFactory.getLogger(AviatorAddFunction.class);
private final List<AbstractFunction> functionList;
@Autowired
public AviatorAddFunction(List<AbstractFunction> functionList) {
this.functionList = functionList;
}
public void init() {
this.functionList.forEach(abstractFunction -> {
LOGGER.info("AviatorAddFunction add: {}", abstractFunction.getName());
AviatorEvaluator.addFunction(abstractFunction);
});
}
}
程序执行时,出现如下异常: com.googlecode.aviator.exception.FunctionNotFoundException: Function not found: path
Please ensure that the path function exists and add it to the AviatorEvaluator before compiling or executing the expression.