public boolean evaluateSimpleUnaryTests(String simpleUnaryTests, String inputName, VariableContext variableContext) { try { ELContext elContext = createContext(variableContext); ValueExpression valueExpression = transformSimpleUnaryTests(simpleUnaryTests, inputName, elContext); return (Boolean) valueExpression.getValue(elContext); } catch (FeelMissingFunctionException e) { throw LOG.unknownFunction(simpleUnaryTests, e); } catch (FeelMissingVariableException e) { if (inputName.equals(e.getVariable())) { throw LOG.unableToEvaluateExpressionAsNotInputIsSet(simpleUnaryTests, e); } else { throw LOG.unknownVariable(simpleUnaryTests, e); } } catch (FeelConvertException e) { throw LOG.unableToConvertValue(simpleUnaryTests, e); } catch (ELException e) { if (e.getCause() instanceof FeelMethodInvocationException) { throw LOG.unableToInvokeMethod(simpleUnaryTests, (FeelMethodInvocationException) e.getCause()); } else { throw LOG.unableToEvaluateExpression(simpleUnaryTests, e); } } }
public boolean evaluateSimpleUnaryTests(String simpleUnaryTests, String inputName, VariableContext variableContext) { try { ELContext elContext = createContext(variableContext); ValueExpression valueExpression = transformSimpleUnaryTests(simpleUnaryTests, inputName, elContext); return (Boolean) valueExpression.getValue(elContext); } catch (FeelMissingFunctionException e) { throw LOG.unknownFunction(simpleUnaryTests, e); } catch (FeelMissingVariableException e) { if (inputName.equals(e.getVariable())) { throw LOG.unableToEvaluateExpressionAsNotInputIsSet(simpleUnaryTests, e); } else { throw LOG.unknownVariable(simpleUnaryTests, e); } } catch (FeelConvertException e) { throw LOG.unableToConvertValue(simpleUnaryTests, e); } catch (ELException e) { if (e.getCause() instanceof FeelMethodInvocationException) { throw LOG.unableToInvokeMethod(simpleUnaryTests, (FeelMethodInvocationException) e.getCause()); } else { throw LOG.unableToEvaluateExpression(simpleUnaryTests, e); } } }