示例#1
0
        public string ReplayOrchestration(string name, string version, string serializedHistoryEvents)
        {

            TaskOrchestration taskOrchestration = this.orchestrationObjectManager.GetObject(name, version);

            IList<HistoryEvent> replayEvents = this.DeserializeHistoryEvents(serializedHistoryEvents);

            if (replayEvents.Any(re => re.EventType == EventType.GenericEvent))
            {
                throw new InvalidOperationException("Cannot replay with GenericEvent");
            }

            var runtimeState = new OrchestrationRuntimeState(this.DeserializeHistoryEvents(serializedHistoryEvents));

            TaskOrchestrationExecutor executor = new TaskOrchestrationExecutor(runtimeState, taskOrchestration);
            return JsonConvert.SerializeObject(executor.Execute(), new JsonSerializerSettings()
            {
                TypeNameHandling = TypeNameHandling.All,
                Formatting = Formatting.Indented
            });
        }
示例#2
0
        public string ReplayOrchestration(string name, string version, string serializedHistoryEvents)
        {
            TaskOrchestration taskOrchestration = this.orchestrationObjectManager.GetObject(name, version);

            IList <HistoryEvent> replayEvents = this.DeserializeHistoryEvents(serializedHistoryEvents);

            if (replayEvents.Any(re => re.EventType == EventType.GenericEvent))
            {
                throw new InvalidOperationException("Cannot replay with GenericEvent");
            }

            var runtimeState = new OrchestrationRuntimeState(this.DeserializeHistoryEvents(serializedHistoryEvents));

            TaskOrchestrationExecutor executor = new TaskOrchestrationExecutor(runtimeState, taskOrchestration);

            return(JsonConvert.SerializeObject(executor.Execute(), new JsonSerializerSettings()
            {
                TypeNameHandling = TypeNameHandling.All,
                Formatting = Formatting.Indented
            }));
        }