Exemple #1
0
        public static UmlUseCaseDiagram ParseUmlUseCaseDiagram(XmlDocument doc, Dictionary <String, UmlActionStateDiagram> dicActionDiagram)
        {
            UmlUseCaseDiagram useCaseDiagram = new UmlUseCaseDiagram();

            foreach (XmlNode caseDiagramNode in doc.SelectNodes("//JUDE:Diagram", ns))
            {
                if (caseDiagramNode.Attributes["xmi.id"] != null)
                {
                    useCaseDiagram.Id       = caseDiagramNode.Attributes["xmi.id"].Value;
                    useCaseDiagram.Name     = caseDiagramNode.Attributes["name"].Value;
                    useCaseDiagram.actors   = UmlActor.ParseActor(caseDiagramNode);
                    useCaseDiagram.useCases = UmlUseCase.ParseUseCase(caseDiagramNode, dicActionDiagram, doc);
                    return(useCaseDiagram);
                }
            }
            return(null);
        }
Exemple #2
0
        public static Dictionary <String, UmlActor> ParseActor(XmlNode node)
        {
            Dictionary <String, UmlActor> dictionaryActor = new Dictionary <string, UmlActor>();

            foreach (XmlNode actorNode in node.SelectNodes("//UML:Model/*/UML:Actor", ns))
            {
                UmlActor actor = new UmlActor();
                actor.Name = actorNode.Attributes["name"].Value;
                actor.Id   = actorNode.Attributes["xmi.id"].Value;

                UmlTag.ParserTag(actorNode, ns, actor);

                foreach (XmlNode NodeTag in actorNode.SelectNodes("//UML:Model/*/UML:Actor[@xmi.id='" + actor.Id + "']//UML:Namespace", ns))
                {
                    actor.refUseCaseDiagram = NodeTag.Attributes["xmi.idref"].Value;
                }
                dictionaryActor.Add(actor.Id, actor);
            }
            return(dictionaryActor);
        }