public void Execute(IExecution execution) { execution.Stop(); int incomingTransitionCount = execution.CurrentNode.IncomingTransitions.Count(); if (incomingTransitionCount > 1) { var root = execution.GetConcurrentRoot(); var executionCollector = new ExecutionCollector(e => !e.IsActive && e.CurrentNode == execution.CurrentNode); root.Accept(executionCollector); int joinedTransitionCount = executionCollector.Result.DistinctBy(e => e.IncomingTransition).Count(); if (incomingTransitionCount > joinedTransitionCount) { Logger.InfoFormat("Cannot join in node '{0}' yet. Joined: {1}, To join: {2}. Waiting...", execution.CurrentNode.Identifier, joinedTransitionCount, incomingTransitionCount); execution.Wait(); return; } root.Split(execution.CurrentNode); } else { execution.Split(execution.CurrentNode); } }