private void Handle(ExecutionPointerCompletedEvent evt)
        {
            var pointer = GetExecutionPointer(evt.ExecutionPathId, evt.ExecutionPointerId);

            pointer.IsActive = false;
            pointer.AddOutgoing(evt.OutcomeValues);
            Version        = evt.Version;
            UpdateDateTime = evt.CompletionDateTime;
        }
        public ICollection <string> CompleteExecutionPointer(ExecutionPointer pointer, ICollection <string> nextFlowIds, ICollection <MessageToken> outcomeValues)
        {
            var evt = new ExecutionPointerCompletedEvent(Guid.NewGuid().ToString(), AggregateId, Version + 1, pointer.ExecutionPathId, pointer.Id, outcomeValues, DateTime.UtcNow);

            Handle(evt);
            DomainEvents.Add(evt);
            var result = new List <string>();

            foreach (var nextFlowId in nextFlowIds)
            {
                result.Add(TryAddExecutionPointer(pointer.ExecutionPathId, GetDefinition(nextFlowId), outcomeValues));
            }

            return(result);
        }