public void SetNextMessageBatch(OrchestrationMessageBatch messageBatch)
 {
     this.MessageBatch      = messageBatch;
     this.NewMessages       = messageBatch.MessagesToProcess;
     this.NewMessagesOrigin = messageBatch.MessagesToProcessOrigin;
     this.OrchestrationRuntimeState.NewEvents.Clear();
 }
 public OrchestrationWorkItem(Partition partition, OrchestrationMessageBatch messageBatch, List <HistoryEvent> previousHistory = null)
 {
     this.Partition                 = partition;
     this.MessageBatch              = messageBatch;
     this.InstanceId                = messageBatch.InstanceId;
     this.NewMessages               = messageBatch.MessagesToProcess;
     this.NewMessagesOrigin         = messageBatch.MessagesToProcessOrigin;
     this.OrchestrationRuntimeState = new OrchestrationRuntimeState(previousHistory);
     this.LockedUntilUtc            = DateTime.MaxValue; // this backend does not require workitem lock renewals
     this.Session = null;                                // we don't use the extended session API because we are caching cursors in the work item
 }