/// <summary>
        /// Add a resume activity to the pending list. NOTE! This does not resume the activity.
        ///
        /// </summary>
        public void ScheduleResume(IRunState runState, ActivityImplementationBase windowsActivity, IWorkflowEvent resumeEvent,
                                   Action <IRunState, ActivityImplementationBase, EntityRef> actionOnCompletion,
                                   Action <IRunState, ActivityImplementationBase> actionOnPause)
        {
            Func <bool> step = () =>
            {
                runState.RecordTrace(windowsActivity.ActivityInstance.Name);
                return(windowsActivity.ResumeInContext(runState, resumeEvent));
            };

            ProcessStep(runState, windowsActivity, actionOnCompletion, actionOnPause, step);
        }
        /// <summary>
        /// Add an activity to the pending list. NOTE! This does not run the activity.
        /// </summary>
        public void ScheduleActivity(IRunState runState, ActivityImplementationBase windowsActivity, ActivityInputs inputs,
                                     Action <IRunState, ActivityImplementationBase, EntityRef> actionOnCompletion,
                                     Action <IRunState, ActivityImplementationBase> actionOnPause)
        {
            Func <bool> step = () =>
            {
                runState.StepsTakenInSession++;

                runState.CurrentActivity = windowsActivity.ActivityInstance;
                runState.RecordTrace(windowsActivity.ActivityInstance.Name);

                return(windowsActivity.RunInContext(runState, inputs));
            };

            ProcessStep(runState, windowsActivity, actionOnCompletion, actionOnPause, step);
        }