public IEnumerable <HistoryEvent> ActivityStartedGraph(Identity activityIdentity, string identity) { var historyEvents = new List <HistoryEvent>(); var eventIds = EventIds.ActivityStartedIds(ref _currentEventId); 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); }