コード例 #1
0
        public IEnumerable <HistoryEvent> ActivityCancelRequestedGraph(Identity activityIdentity, string identity)
        {
            var historyEvents = new List <HistoryEvent>();
            var eventIds      = EventIds.ActivityCancelRequestedIds(ref _currentEventId);

            historyEvents.Add(new HistoryEvent()
            {
                EventType = EventType.ActivityTaskCancelRequested,
                EventId   = eventIds.EventId(EventIds.CancelRequested),
                ActivityTaskCancelRequestedEventAttributes = new ActivityTaskCancelRequestedEventAttributes()
                {
                    ActivityId = activityIdentity.Id,
                }
            });

            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);
        }