コード例 #1
0
ファイル: FeelEngine.cs プロジェクト: zf321/ESS.FW.Bpm
 public virtual bool EvaluateSimpleUnaryTests(string simpleUnaryTests, string inputName, IVariableContext variableContext)
 {
     try
     {
         ELContext       elContext       = CreateContext(variableContext);
         ValueExpression valueExpression = TransformSimpleUnaryTests(simpleUnaryTests, inputName, elContext);
         return((bool)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.InnerException is FeelMethodInvocationException)
         {
             throw LOG.unableToInvokeMethod(simpleUnaryTests, (FeelMethodInvocationException)e.InnerException);
         }
         else
         {
             throw LOG.unableToEvaluateExpression(simpleUnaryTests, e);
         }
     }
 }