Beispiel #1
0
 public void UpdateInstance(
     Instance instance,
     OrchestrationRuntimeState runtimeState)
 {
     instance.LastExecutionId = runtimeState.OrchestrationInstance.ExecutionId;
     instance.LastQueueName   = QueueMapper.ToQueueName(runtimeState.Name, runtimeState.Version);
 }
Beispiel #2
0
        public Instance CreateInstance(ExecutionStartedEvent executionStartedEvent)
        {
            var instance = new Instance
            {
                InstanceId      = executionStartedEvent.OrchestrationInstance.InstanceId,
                LastExecutionId = executionStartedEvent.OrchestrationInstance.ExecutionId,
                LockedUntil     = DateTime.UtcNow,
                LastQueueName   = QueueMapper.ToQueueName(executionStartedEvent.Name, executionStartedEvent.Version)
            };

            return(instance);
        }
        public ActivityMessage CreateActivityMessage(
            TaskMessage message,
            string replyQueue)
        {
            var taskScheduledEvent = message.Event as TaskScheduledEvent;

            return(new ActivityMessage
            {
                Id = Guid.NewGuid(),
                CreatedAt = DateTime.UtcNow,
                Queue = QueueMapper.ToQueueName(taskScheduledEvent.Name, taskScheduledEvent.Version),
                ReplyQueue = replyQueue,
                InstanceId = message.OrchestrationInstance.InstanceId,
                Message = _options.DataConverter.Serialize(message),
                LockedUntil = DateTime.UtcNow
            });
        }