/// <summary> /// /// </summary> /// <param name="variableScope"></param> /// <returns></returns> public virtual object GetValue(IVariableScope variableScope) { ELContext elContext = Context.ProcessEngineConfiguration.ExpressionManager.GetElContext(variableScope); try { ExpressionGetInvocation invocation = new ExpressionGetInvocation(valueExpression, elContext); Context.ProcessEngineConfiguration.DelegateInterceptor.HandleInvocation(invocation); return(invocation.InvocationResult); } //catch (PropertyNotFoundException pnfe) //{ // throw new ActivitiException("Unknown property used in expression: " + expressionText, pnfe); //} //catch (MethodNotFoundException mnfe) //{ // throw new ActivitiException("Unknown method used in expression: " + expressionText, mnfe); //} //catch (ELException ele) //{ // throw new ActivitiException("Error while evaluating expression: " + expressionText, ele); //} catch (Exception e) { throw new ActivitiException("Error while evaluating expression: " + expressionText, e); } }
public virtual object GetValue(IVariableScope variableScope, IBaseDelegateExecution contextExecution) { var elContext = ExpressionManager.GetElContext(variableScope); try { var invocation = new ExpressionGetInvocation(ValueExpression, elContext, contextExecution); Context.ProcessEngineConfiguration.DelegateInterceptor.HandleInvocation(invocation); return(invocation.InvocationResult); } catch (PropertyNotFoundException pnfe) { throw new ProcessEngineException( "Unknown property used in expression: " + ExpressionText + ". Cause: " + pnfe.Message, pnfe); } catch (MethodNotFoundException mnfe) { throw new ProcessEngineException( "Unknown method used in expression: " + ExpressionText + ". Cause: " + mnfe.Message, mnfe); } catch (ELException ele) { throw new ProcessEngineException( "Error while evaluating expression: " + ExpressionText + ". Cause: " + ele.Message, ele); } catch (System.Exception e) { throw new ProcessEngineException( "Error while evaluating expression: " + ExpressionText + ". Cause: " + e.Message, e); } }