from com.modeliosoft.modelio.api.mdac import IMdac from com.modeliosoft.modelio.api.mdac import MdacException from com.modeliosoft.modelio.core.mdacs import IMdacRegistry from com.modeliosoft.modelio.mdainfra.mdacs.core import MdacManager from com.modeliosoft.modelio.core.app import O session = O.getDefault().getModelingSession() registry = session.getMdacRegistry() manager = MdacManager(session) t = modelingSession.createTransaction("reload TogafArchitect") for mdacmodel in session.getModel().getProject().getInstalled(): print mdacmodel if (mdacmodel.getName() == "TogafArchitect"): currentMdac = registry.getLoadedMdac(mdacmodel) if (currentMdac != None): print "stopping", currentMdac manager.stopMdac(currentMdac) print "unloading", currentMdac manager.unloadMdac(currentMdac) print "loading", mdacmodel currentMdac = manager.loadMdac(mdacmodel) if (currentMdac != None): print "starting", currentMdac manager.startMdac(currentMdac) modelingSession.commit(t)
from com.modeliosoft.modelio.api.mdac import IMdac from com.modeliosoft.modelio.api.mdac import MdacException from com.modeliosoft.modelio.api.model import ObModule from com.modeliosoft.modelio.bridges.mda.infra import MdacManagerBridge from com.modeliosoft.modelio.core.mdacs import IMdacRegistry from com.modeliosoft.modelio.mdainfra.mdacs.core import MdacLoader from com.modeliosoft.modelio.mdainfra.mdacs.core import MdacManager from com.modeliosoft.modelio.core.app import O t = modelingSession.createTransaction("reload") session = O.getDefault ().getModelingSession () registry = session.getMdacRegistry () manager = MdacManager (session) for mdacmodel in MdacManagerBridge.getSelectedMdacModels (session.getNativeSession()): print mdacmodel if (mdacmodel.getName () == "TogafArchitect"): currentMdac = registry.getLoadedMdac (mdacmodel); if (currentMdac == None): loader = MdacLoader (session, manager, session.getWorkspacePath ()) mdaClasspath = manager.getMdacClasspath (mdacmodel) print "loading", mdacmodel currentMdac = loader.loadMdac (mdacmodel, mdaClasspath); if (currentMdac != None): print "restarting", currentMdac manager.restartModule (currentMdac) modelingSession.commit (t)
from com.modeliosoft.modelio.api.mdac import IMdac from com.modeliosoft.modelio.api.mdac import MdacException from com.modeliosoft.modelio.core.mdacs import IMdacRegistry from com.modeliosoft.modelio.mdainfra.mdacs.core import MdacManager from com.modeliosoft.modelio.core.app import O session = O.getDefault ().getModelingSession () registry = session.getMdacRegistry () manager = MdacManager (session) t = modelingSession.createTransaction("reload TogafArchitect") for mdacmodel in session.getModel().getProject().getInstalled(): print mdacmodel if (mdacmodel.getName () == "TogafArchitect"): currentMdac = registry.getLoadedMdac (mdacmodel) if (currentMdac != None): print "stopping", currentMdac manager.stopMdac(currentMdac) print "unloading", currentMdac manager.unloadMdac (currentMdac) print "loading", mdacmodel currentMdac = manager.loadMdac(mdacmodel) if (currentMdac != None): print "starting", currentMdac manager.startMdac(currentMdac) modelingSession.commit (t)