internal ExitTransition(ExitTransitionDefinitionSyntax syntax,
                                TaskDefinitionSymbol taskDefinition,
                                [CanBeNull] NodeReferenceSymbol source,
                                [CanBeNull] ConnectionPointReferenceSymbol connectionPoint,
                                [CanBeNull] EdgeModeSymbol edgeMode,
                                [CanBeNull] NodeReferenceSymbol target) {

            if (syntax == null) {
                throw new ArgumentNullException(nameof(syntax));
            }
            if (taskDefinition == null) {
                throw new ArgumentNullException(nameof(taskDefinition));
            }

            Syntax          = syntax;
            TaskDefinition = taskDefinition;
            Source          = source;
            ConnectionPoint = connectionPoint;
            EdgeMode        = edgeMode;
            Target          = target;

            if(connectionPoint != null) {                
                connectionPoint.ExitTransition = this;
            }
        }
        internal ExitTransition(ExitTransitionDefinitionSyntax syntax, INodeReferenceSymbol source, IConnectionPointReferenceSymbol connectionPoint, IEdgeModeSymbol edgeMode, INodeReferenceSymbol target) {

            if (syntax == null) {
                throw new ArgumentNullException(nameof(syntax));
            }

            Syntax          = syntax;
            Source          = source;
            ConnectionPoint = connectionPoint;
            EdgeMode        = edgeMode;
            Target          = target;
        }
        public override void VisitExitTransitionDefinition(ExitTransitionDefinitionSyntax exitTransitionDefinitionSyntax) {
            // Source
            ITaskNodeSymbol sourceTaskNodeSymbol = null;
            NodeReferenceSymbol sourceNodeReference = null;
            var sourceNodeSyntax = exitTransitionDefinitionSyntax.SourceNode;
            if (sourceNodeSyntax != null) {

                // Source in Exit Transition muss immer ein Task sein
                sourceTaskNodeSymbol = _taskDefinition.NodeDeclarations.TryFindSymbol(sourceNodeSyntax.Name) as ITaskNodeSymbol;
                var location         = sourceNodeSyntax.GetLocation();

                if (location != null) {
                    sourceNodeReference = new NodeReferenceSymbol(sourceNodeSyntax.Name, location, sourceTaskNodeSymbol);
                }
            }

            // ConnectionPoint
            ConnectionPointReferenceSymbol connectionPointReference = null;
            var exitIdentifier = exitTransitionDefinitionSyntax.ExitIdentifier;
            if (!exitIdentifier.IsMissing && sourceTaskNodeSymbol != null) {

                var exitIdentifierName  = exitIdentifier.ToString();
                var exitConnectionPoint = sourceTaskNodeSymbol.Declaration?.ConnectionPoints.TryFindSymbol(exitIdentifierName) as IExitConnectionPointSymbol;
                var location            = exitIdentifier.GetLocation();

                if (location != null) {
                    connectionPointReference = new ConnectionPointReferenceSymbol(exitIdentifierName, location, exitConnectionPoint);
                }
            }

            // Target
            NodeReferenceSymbol targetNodeReference = null;
            var targetNodeSyntax = exitTransitionDefinitionSyntax.TargetNode;
            if (targetNodeSyntax != null) {

                var targetNode = _taskDefinition.NodeDeclarations.TryFindSymbol(targetNodeSyntax.Name);
                var location   = targetNodeSyntax.GetLocation();

                if(location != null) {
                    targetNodeReference = new NodeReferenceSymbol(targetNodeSyntax.Name, location, targetNode);
                }
            }

            // Edge
            EdgeModeSymbol edgeMode = null;
            var edgeSyntax = exitTransitionDefinitionSyntax.Edge;
            if (edgeSyntax != null) {

                var location = edgeSyntax.GetLocation();

                if(location != null) {
                    edgeMode = new EdgeModeSymbol(edgeSyntax.ToString(), location, edgeSyntax.Mode);
                }
            }

            var exitTransition = new ExitTransition(exitTransitionDefinitionSyntax, _taskDefinition, sourceNodeReference, connectionPointReference, edgeMode, targetNodeReference);

            AddExitTransition(exitTransition);
        }
		public override void PostWalkExitTransitionDefinition(ExitTransitionDefinitionSyntax exitTransitionDefinitionSyntax) { 
			MethodsCalled["PostWalkExitTransitionDefinition"]=true;
		}
		// ExitTransitionDefinitionSyntax
		public override bool WalkExitTransitionDefinition(ExitTransitionDefinitionSyntax exitTransitionDefinitionSyntax) { 
			MethodsCalled["WalkExitTransitionDefinition"]=true;
			return true; 
		}