/// <summary> /// Assigns this activity to be performed by the specified performer. The value may be null, /// in which case the activity is un-assigned. /// </summary> /// <param name="performer"></param> public virtual void Assign(ActivityPerformer performer) { if (this.State != ActivityStatus.SC) { throw new WorkflowException("Assignment of scheduled performer only allowed from scheduled state"); } if (_scheduling == null) { _scheduling = new ActivityScheduling(); } this.Scheduling.Performer = performer; OnSchedulingChanged(); }
/// <summary> /// Schedules or re-schedules the activity at the specified start time. The end time is optional. /// </summary> /// <param name="startTime"></param> /// <param name="endTime"></param> public virtual void Schedule(DateTime?startTime, DateTime?endTime) { if (this.State != ActivityStatus.SC) { throw new WorkflowException("Schedule is only allowed from Scheduled state"); } if (_scheduling == null) { _scheduling = new ActivityScheduling(); } this.Scheduling.StartTime = startTime; this.Scheduling.EndTime = endTime; OnSchedulingChanged(); }
/// <summary> /// Protected constructor that allows for customized FSM logic. Typically there should be no need to customize the FSM logic. /// </summary> /// <param name="transitionLogic"></param> protected Activity(IFsmTransitionLogic <ActivityStatus> transitionLogic) : base(ActivityStatus.SC, transitionLogic) { _performedSteps = new HashedSet <PerformedStep>(); _scheduling = new ActivityScheduling(); }