public Task Update(Domains.ProcessInstanceAggregate workflowInstance, CancellationToken token)
        {
            var instance = _instances.First(i => i.AggregateId == workflowInstance.AggregateId);
            var clone    = (Domains.ProcessInstanceAggregate)workflowInstance.Clone();

            _instances.Remove(instance);
            _instances.Add(clone);
            return(Task.CompletedTask);
        }
 public Task Add(Domains.ProcessInstanceAggregate workflowInstance, CancellationToken token)
 {
     _instances.Add((Domains.ProcessInstanceAggregate)workflowInstance.Clone());
     return(Task.CompletedTask);
 }