/// <summary>
        ///     Takes an <seealso cref="IActivityExecution" />  and wraps
        ///     the call to the Callable with the proper error propagation. This method
        ///     also makes sure that exceptions not caught by following activities in the
        ///     process will be thrown and not propagated.
        /// </summary>
        /// <param name="execution"> </param>
        /// <param name="toExecute"> </param>
        /// <exception cref="exception"> </exception>
        protected internal virtual void ExecuteWithErrorPropagation(IActivityExecution execution,
                                                                    Action toExecute)
        {
            var activityInstanceId = execution.ActivityInstanceId;

            try
            {
                toExecute.Invoke();
            }
            catch (System.Exception ex)
            {
                execution.CreateIncident(IncidentFields.FailedTask, "", ex.ToString().Length > 1500? ex.ToString().Substring(0, 1500): ex.ToString());
                if (activityInstanceId == execution.ActivityInstanceId)
                {
                    try
                    {
                        PropagateException(execution, ex);
                    }
                    catch (ErrorPropagationException e)
                    {
                        LOG.ErrorPropagationException(activityInstanceId, e.InnerException);
                        // re-throw the original exception so that it is logged
                        // and set as cause of the failure
                        throw ex;
                    }
                }
                else
                {
                    throw ex;
                }
            }
        }