Ejemplo n.º 1
0
        public void ParseXmiToOATS(string XmiPath, string OATSPath)
        {
            UmlModel    model  = new UmlModel("");
            XmlDocument xmiDoc = new XmlDocument();

            xmiDoc.Load(XmiPath);
            XmiImporter importer = new XmiImporter();
            String      name     = "";

            model = importer.FromXmi(xmiDoc, ref name);


            if (model.Diagrams.Count(X => X is UmlActivityDiagram) > 1)
            {
                throw new Exception("Only one Activity diagram allowed! (For now)");
            }
            try
            {
                UmlToFsm umlToFsm = new UmlToFsm();
                foreach (UmlActivityDiagram actDiag in model.Diagrams)
                {
                    tabs = 0;
                    sw   = new StreamWriter(OATSPath + "\\script.java");
                    fsm  = umlToFsm.ActivityDiagramToFsm(actDiag, model);
                    //fsm.
                    currState  = fsm.InitialState;
                    curActDiag = actDiag;
                    S();
                    sw.Close();
                    break;//only one
                }
            }
            catch (Exception ex)
            {
                if (sw != null)
                {
                    sw.Close();
                }
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public static List <GeneralUseStructure> GetFSMUmlActOats()
        {
            try
            {
                List <GeneralUseStructure> listModel;
                StructureType type;
                UmlToFsm      converter;

                listModel = new List <GeneralUseStructure>();
                listModel = GetStructureCollectionActOats();

                converter = new UmlToFsm();

                //this parameter is not used
                type = StructureType.OATS;

                return(converter.Converter(listModel, type));
            }
            catch (Exception e)
            {
                throw new Exception("There's a problem with UmlToFsm: " + e.Message);
            }
        }
Ejemplo n.º 3
0
 public void Initializer()
 {
     converter = new UmlToFsm();
 }