コード例 #1
0
        public IEnumerable <EmrActivity> GetActivities(EmrActivitiesRunner emrRunner)
        {
            foreach (EmrActivity successFlowActivity in this.GetNormalFlow(emrRunner))
            {
                if (this.hasError)
                {
                    foreach (EmrActivity failedFlowActivity in this.GetFailedFlow(emrRunner))
                    {
                        yield return(failedFlowActivity);
                    }

                    yield break;
                }

                yield return(successFlowActivity);
            }
        }
コード例 #2
0
 /// <summary>
 /// A sequence of activities, if an error has occurred
 /// </summary>
 /// <param name="emrRunner">Reference to the emrRunner</param>
 /// <returns>Sequence of bad activities</returns>
 protected virtual IEnumerable <EmrActivity> GetFailedFlow(EmrActivitiesRunner emrRunner)
 {
     yield break;
 }
コード例 #3
0
 /// <summary>
 /// A normal sequence of activities, if no errors
 /// </summary>
 /// <param name="emrRunner">Reference to the emrRunner</param>
 /// <returns>Sequence of good activities</returns>
 protected abstract IEnumerable <EmrActivity> GetNormalFlow(EmrActivitiesRunner emrRunner);
コード例 #4
0
 /// <summary>
 /// Notify an iterator that the job failed, so it can switch to
 /// an alternative activities sequence
 /// or terminate the job flow
 /// or ignore it =)
 /// </summary>
 /// <param name="emrRunner">Reference to the emrRunner</param>
 public virtual void NotifyJobFailed(EmrActivitiesRunner emrRunner)
 {
     this.hasError = true;
 }