示例#1
0
from com.nomagic.uml2.ext.magicdraw.actions.mdbasicactions import *
from com.nomagic.uml2.ext.magicdraw.activities.mdbasicactivities import *
from com.nomagic.uml2.ext.magicdraw.activities.mdintermediateactivities import *
from com.nomagic.uml2.ext.magicdraw.auxiliaryconstructs.mdinformationflows import *
from com.nomagic.uml2.ext.magicdraw.compositestructures.mdports import *
from com.nomagic.uml2.ext.magicdraw.commonbehaviors.mdsimpletime import *
from com.nomagic.uml2.ext.magicdraw.interactions.mdbasicinteractions import Interaction
from com.nomagic.uml2.ext.magicdraw.classes.mdpowertypes import GeneralizationSet
from com.nomagic.uml2.ext.magicdraw.commonbehaviors.mdcommunications import Reception, Signal
from com.nomagic.uml2.ext.magicdraw.activities.mdfundamentalactivities import Activity
from com.nomagic.uml2.ext.jmi.helpers import CoreHelper

gl = Application.getInstance().getGUILog()
project = Application.getInstance().getProject()
ef = project.getElementsFactory()
mem = ModelElementsManager.getInstance()
sysmlProf=StereotypesHelper.getProfile(project,"SysML")
sysmlSt=StereotypesHelper.getStereotypesByProfile(sysmlProf)
datapack=project.getModel()
noApply = {}

def validateLocation(modelPackage, validateOnly, ignorePack):
	sterPlace =[]
	custPlace =[]
	if validateOnly!=True: gl.log('[FIXES]: for Package, Stereotypes, and Customization Locations')
###Find profile package
	profilePackage = profilePackCheck(modelPackage)
	if not profilePackage: return ['No Profile Package']
###Find infrastructure package
	infraPack = filter(lambda element: isinstance(element, Package) and "_"==element.getName(), profilePackage.getOwnedElement())
	if len(infraPack)>0: infraPack = infraPack[0]
示例#2
0
def removePackage(package):
    ModelElementsManager.getInstance().removeElement(package)