public IEnumerable <HistoryEvent> ActivityCancellationFailedGraph(Identity activityId, string cause) { var historyEvents = new List <HistoryEvent>(); var eventIds = EventIds.CompletedIds(ref _currentEventId); historyEvents.Add(new HistoryEvent() { EventType = EventType.RequestCancelActivityTaskFailed, EventId = eventIds.EventId(EventIds.Completion), RequestCancelActivityTaskFailedEventAttributes = new RequestCancelActivityTaskFailedEventAttributes() { ActivityId = activityId.Id, Cause = cause } }); historyEvents.Add(new HistoryEvent() { EventType = EventType.ActivityTaskStarted, EventId = eventIds.EventId(EventIds.Started), ActivityTaskStartedEventAttributes = new ActivityTaskStartedEventAttributes() { Identity = "someid", ScheduledEventId = eventIds.EventId(EventIds.Scheduled) } }); historyEvents.Add(new HistoryEvent() { EventType = EventType.ActivityTaskScheduled, EventId = eventIds.EventId(EventIds.Scheduled), ActivityTaskScheduledEventAttributes = new ActivityTaskScheduledEventAttributes() { ActivityType = new ActivityType() { Name = activityId.Name, Version = activityId.Version }, ActivityId = activityId.Id, Control = (new ActivityScheduleData() { PN = activityId.PositionalName }).ToJson(), } }); return(historyEvents); }
public IEnumerable <HistoryEvent> ActivityFailedGraph(Identity activityIdentity, string identity, string reason, string detail) { var historyEvents = new List <HistoryEvent>(); var eventIds = EventIds.CompletedIds(ref _currentEventId); historyEvents.Add(new HistoryEvent() { EventType = EventType.ActivityTaskFailed, EventId = eventIds.EventId(EventIds.Completion), ActivityTaskFailedEventAttributes = new ActivityTaskFailedEventAttributes() { Details = detail, Reason = reason, ScheduledEventId = eventIds.EventId(EventIds.Scheduled), StartedEventId = eventIds.EventId(EventIds.Started) } }); historyEvents.Add(new HistoryEvent() { EventType = EventType.ActivityTaskStarted, EventId = eventIds.EventId(EventIds.Started), ActivityTaskStartedEventAttributes = new ActivityTaskStartedEventAttributes() { Identity = identity, ScheduledEventId = eventIds.EventId(EventIds.Scheduled) } }); historyEvents.Add(new HistoryEvent() { EventType = EventType.ActivityTaskScheduled, EventId = eventIds.EventId(EventIds.Scheduled), ActivityTaskScheduledEventAttributes = new ActivityTaskScheduledEventAttributes() { ActivityType = new ActivityType() { Name = activityIdentity.Name, Version = activityIdentity.Version }, Control = (new ActivityScheduleData() { PN = activityIdentity.PositionalName }).ToJson(), ActivityId = activityIdentity.Id } }); return(historyEvents); }
public IEnumerable <HistoryEvent> ActivityCompletedGraph(Identity activityIdentity, string workerIdentity, string result, string input = "") { var historyEvents = new List <HistoryEvent>(); var eventIds = EventIds.CompletedIds(ref _currentEventId); historyEvents.Add(new HistoryEvent() { EventType = EventType.ActivityTaskCompleted, EventId = eventIds.EventId(EventIds.Completion), ActivityTaskCompletedEventAttributes = new ActivityTaskCompletedEventAttributes() { Result = result, StartedEventId = eventIds.EventId(EventIds.Started), ScheduledEventId = eventIds.EventId(EventIds.Scheduled) } }); historyEvents.Add(new HistoryEvent() { EventType = EventType.ActivityTaskStarted, EventId = eventIds.EventId(EventIds.Started), ActivityTaskStartedEventAttributes = new ActivityTaskStartedEventAttributes() { Identity = workerIdentity, ScheduledEventId = eventIds.EventId(EventIds.Scheduled) } }); historyEvents.Add(new HistoryEvent() { EventType = EventType.ActivityTaskScheduled, EventId = eventIds.EventId(EventIds.Scheduled), ActivityTaskScheduledEventAttributes = new ActivityTaskScheduledEventAttributes() { ActivityType = new ActivityType() { Name = activityIdentity.Name, Version = activityIdentity.Version }, Control = (new ActivityScheduleData() { PN = activityIdentity.PositionalName }).ToJson(), ActivityId = activityIdentity.Id, Input = input } }); return(historyEvents); }