Exemple #1
0
        /// <summary>
        /// Update all the mapping variables associated with the activity.
        /// </summary>
        private object EvaluateExpression(IRunState context, WfExpression expression)
        {
            try
            {
                object evaluatedValue;
                try
                {
                    evaluatedValue = context.EvaluateExpression(expression);
                }
                catch (System.Data.EvaluateException ex)
                {
                    throw new WorkflowRunException(ex.Message, ex);
                }

                return(evaluatedValue);
            }
            catch (WorkflowRunException)
            {
                throw;
            }
            catch (WorkflowRunException_Internal)
            {
                throw;
            }
            catch (Exception e)
            {
                if (expression != null)
                {
                    EventLog.Application.WriteError("Exception in Workflow UpdateExpression for Expression id {0} string \"{1}\" : {2}", expression.Id, expression.ExpressionString ?? "null", e.Message);
                }
                else
                {
                    EventLog.Application.WriteError("Exception in Workflow UpdateExpression for Expression (null): {0}", e.Message);
                }
                throw;
            }
        }