public static UmlFinalState ParserFinalState(XmlNode activityDiagramNode, String id)
        {
            UmlFinalState stateEnd = new UmlFinalState();

            foreach (XmlNode NodeFinalState in activityDiagramNode.SelectNodes("//UML:ActivityGraph[@xmi.id='" + id + "']//UML:FinalState ", ns))
            {
                stateEnd.stateInicio = NodeFinalState.Attributes["xmi.id"].Value;
                stateEnd.Id          = NodeFinalState.Attributes["xmi.id"].Value;
                stateEnd.Name        = NodeFinalState.Attributes["name"].Value;

                foreach (XmlNode NodeStateVertex in NodeFinalState.SelectNodes("//UML:FinalState[@xmi.id='" + stateEnd.Id + "']//UML:StateVertex.incoming//UML:Transition", ns))
                {
                    stateEnd.incoming = NodeStateVertex.Attributes["xmi.idref"].Value;
                }
            }
            if (stateEnd.incoming == null)
            {
                throw new InvalidEndNode();
            }
            return(stateEnd);
        }
        public static Dictionary <String, UmlActionStateDiagram> ParseActivityDiagram(XmlDocument doc)
        {
            UmlActionStateDiagram.collectJudeHyperLinksReferences(doc);
            Dictionary <String, UmlActionStateDiagram> dictionaryActivityDiagram = new Dictionary <string, UmlActionStateDiagram>();


            foreach (XmlNode activityDiagramNode in doc.SelectNodes("//UML:Model//UML:ActivityGraph", ns))
            {
                if (activityDiagramNode.Attributes["xmi.id"] != null)
                {
                    UmlActionStateDiagram activityDiagram = new UmlActionStateDiagram();
                    activityDiagram.Name        = activityDiagramNode.Attributes["name"].Value;
                    activityDiagram.Id          = activityDiagramNode.Attributes["xmi.id"].Value;
                    activityDiagram.transitions = UmlTransition.ParserTransition(activityDiagramNode, activityDiagram.Id);
                    dictionaryActivityDiagram.Add(activityDiagram.Id, activityDiagram);
                    UmlActionState.ParseActivity(activityDiagramNode, activityDiagram.Id, activityDiagram);
                    activityDiagram.InitialActivity = UmlInitialState.ParserPseudostate(activityDiagramNode, activityDiagram.Id);
                    activityDiagram.FinalActivity   = UmlFinalState.ParserFinalState(activityDiagramNode, activityDiagram.Id);
                }
            }
            foreach (var item in dictionaryActivityDiagram.Keys)
            {
                foreach (var item2 in dictionaryActivityDiagram[item].dicAtivities.Keys)
                {
                    UmlActionState activity = dictionaryActivityDiagram[item].dicAtivities[item2];
                    foreach (String item3 in activity.dicJudeHyperLink.Keys)
                    {
                        //Id UML
                        String key = UmlActionStateDiagram.dicJudeHyperLinks[item3];
                        UmlActionStateDiagram diagram = dictionaryActivityDiagram[key];
                        activity.dicMyLinkedDiagrams.Add(diagram.Id, diagram);
                    }
                }
            }

            return(dictionaryActivityDiagram);
        }