/// <summary> /// Reschedule the item, associated with passed event. /// </summary> /// <param name="workflowItemEvent"></param> /// <returns></returns> protected ScheduleWorkflowItemAction Reschedule(WorkflowItemEvent workflowItemEvent) { Ensure.NotNull(workflowItemEvent, "workflowItemEvent"); var workflowItem = _allWorkflowItems.WorkflowItemFor(workflowItemEvent); return(WorkflowAction.Schedule(workflowItem)); }
/// <summary> /// Continue the scheduling the of child items. All child items will be scheduled as per Deflow algorithm. /// </summary> /// <param name="workflowItemEvent"></param> /// <returns></returns> protected WorkflowAction Continue(WorkflowItemEvent workflowItemEvent) { Ensure.NotNull(workflowItemEvent, "workflowItemEvent"); var workfowItem = _allWorkflowItems.WorkflowItemFor(workflowItemEvent); return(WorkflowAction.ContinueWorkflow(workfowItem)); }
public LambdaItem LambdaItem(WorkflowItemEvent @event) { var item = _workflowItems.OfType <LambdaItem>().FirstOrDefault(@event.IsFor); if (item == null) { throw new IncompatibleWorkflowException($"Can not find workflow item for event {@event}"); } return(item); }
public ActivityItem ActivityItem(WorkflowItemEvent workflowItemEvent) { var workflowActivity = Activity(workflowItemEvent); if (workflowActivity == null) { throw new IncompatibleWorkflowException(string.Format("Can not find activity for event {0}.", workflowItemEvent)); } return(workflowActivity); }
public WorkflowItem WorkflowItem(WorkflowItemEvent workflowItemEvent) { var workflowItem = _workflowItems.FirstOrDefault(workflowItemEvent.IsFor); if (workflowItem == null) { throw new IncompatibleWorkflowException($"Can not find workflow item for event {workflowItemEvent}"); } return(workflowItem); }
public ITimer TimerFor(WorkflowItemEvent workflowItemEvent) { var timer = _workflowItems.FirstOrDefault(workflowItemEvent.IsFor) as ITimer; if (timer == null) { throw new IncompatibleWorkflowException(string.Format("Can not find timer for event {0}", workflowItemEvent)); } return(timer); }
public WorkflowItem WorkflowItemFor(WorkflowItemEvent workflowItemEvent) { var workflowItem = _workflowItems.FirstOrDefault(workflowItemEvent.IsFor); if (workflowItem == null) { throw new IncompatibleWorkflowException(string.Format("Can not find workflow item for event {0}", workflowItemEvent)); } return(workflowItem); }
public ITimer Timer(WorkflowItemEvent workflowItemEvent) { var timer = _workflowItems.FirstOrDefault(workflowItemEvent.IsFor); if (timer == null) { throw new IncompatibleWorkflowException($"Can not find timer for event {workflowItemEvent}"); } return(timer); }
public WorkflowItemEvent LastActivityEventFor(ActivityItem activityItem) { WorkflowItemEvent result = null; if (_cachedActivityEvents.TryGetValue(activityItem, out result)) { return(result); } result = AllActivityEventsFor(activityItem).FirstOrDefault(); _cachedActivityEvents.Add(activityItem, result); return(result); }
public WorkflowItemEvent LastTimerEventFor(TimerItem timerItem) { WorkflowItemEvent result = null; if (_cachedTimerEvents.TryGetValue(timerItem, out result)) { return(result); } result = AllTimerEventsFor(timerItem).FirstOrDefault(); _cachedTimerEvents.Add(timerItem, result); return(result); }
internal WorkflowItemWaitAction(WorkflowItemEvent itemEvent, SignalWaitType waitType, params string[] signalNames) { _scheduleId = itemEvent.ScheduleId; _waitingEventTimeStamp = itemEvent.Timestamp; _data = new WaitForSignalData { ScheduleId = itemEvent.ScheduleId, TriggerEventId = itemEvent.EventId, WaitType = waitType, SignalNames = signalNames, NextAction = SignalNextAction.Continue, TriggerEventCompletionDate = itemEvent.Timestamp }; }
public override WorkflowItemEvent LastEvent(bool includeRescheduleTimerEvents = false) { var lastEvent = WorkflowHistoryEvents.LastChildWorkflowEvent(this); WorkflowItemEvent timerEvent = null; if (includeRescheduleTimerEvents) { timerEvent = WorkflowHistoryEvents.LastTimerEvent(RescheduleTimer, true); } if (lastEvent > timerEvent) { return(lastEvent); } return(timerEvent); }
public IEnumerable <WorkflowItemEvent> LastSimilarEvents() { WorkflowItemEvent lastEvent = null; foreach (var @event in AllEvents()) { lastEvent = lastEvent ?? @event; if (lastEvent.GetType() == @event.GetType()) { yield return(@event); } else { yield break; } } }
public override WorkflowItemEvent LastEvent(bool includeRescheduleTimerEvents = false) { var latestActivityEvent = WorkflowHistoryEvents.LastActivityEvent(this); WorkflowItemEvent latestTimerEvent = null; if (includeRescheduleTimerEvents) { latestTimerEvent = WorkflowHistoryEvents.LastTimerEvent(RescheduleTimer, true); } if (latestActivityEvent > latestTimerEvent) { return(latestActivityEvent); } return(latestTimerEvent); }
/// <summary> /// Returns the child activity for given event. /// </summary> /// <param name="activityEvent"></param> /// <returns></returns> protected IActivityItem Activity(WorkflowItemEvent activityEvent) { Ensure.NotNull(activityEvent, "@event"); return(_allWorkflowItems.ActivityOf(activityEvent)); }
internal bool HasSameScheduleId(WorkflowItemEvent other) => ScheduleId == other.ScheduleId;
internal bool IsForSameWorkflowItemAs(WorkflowItemEvent otherWorkflowItemEvent) { return(AwsIdentity == otherWorkflowItemEvent.AwsIdentity); }
public TimerItem TimerItem(WorkflowItemEvent timerEvent) { return(_workflowItems.OfType <TimerItem>().FirstOrDefault(timerEvent.IsFor)); }
private static bool IsRescheduleTimerEvent(WorkflowItemEvent @event) { var timerEvent = @event as TimerEvent; return(timerEvent != null && timerEvent.TimerType == TimerType.Reschedule); }
private static bool IsSignalTimerEvent(WorkflowItemEvent @event) { var timerEvent = @event as TimerEvent; return(timerEvent != null && timerEvent.TimerType == TimerType.SignalTimer); }
public ActivityItem Activity(WorkflowItemEvent activityEvent) { return(_workflowItems.OfType <ActivityItem>().FirstOrDefault(activityEvent.IsFor)); }
WorkflowAction IWorkflowDefaultActions.Continue(WorkflowItemEvent workflowItemEvent) { return(Continue(workflowItemEvent)); }
/// <summary> /// Returns child workflow for given event. /// </summary> /// <param name="event"></param> /// <returns></returns> protected IChildWorkflowItem ChildWorkflow(WorkflowItemEvent @event) { Ensure.NotNull(@event, nameof(@event)); return(_allWorkflowItems.ChildWorkflowItem(@event)); }
public bool HasItemFor(WorkflowItemEvent @event) => AllItems.Any(@event.IsFor);
public bool Contains(WorkflowItemEvent @event) => _filterOutTypes.Contains(@event.GetType());
/// <summary> /// Returns child timer for given <see cref="WorkflowItemEvent"/>. /// </summary> /// <param name="event"></param> /// <returns></returns> protected ITimerItem Timer(WorkflowItemEvent @event) { Ensure.NotNull(@event, "@event"); return(_allWorkflowItems.TimerItemFor(@event)); }
/// <summary> /// Returns the lambda for given event. /// </summary> /// <param name="event"></param> /// <returns></returns> protected ILambdaItem Lambda(WorkflowItemEvent @event) { Ensure.NotNull(@event, "@event"); return(_allWorkflowItems.LambdaItem(@event)); }