diff --git a/MTIP/Constants/StateMachineConstants.cs b/MTIP/Constants/StateMachineConstants.cs index b1e96d0..d3d41bd 100644 --- a/MTIP/Constants/StateMachineConstants.cs +++ b/MTIP/Constants/StateMachineConstants.cs @@ -7,36 +7,18 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class StateMachineConstants + public static class StateMachineConstants { - public string deepHistory; - public string entryPoint; - public string exitPoint; - public string region; - public string shallowHistory; - public string state; - public string stateMachine; - public string stateNode; - public string synchronization; - public string trigger; - public StateMachineConstants() - { - entryPoint = "EntryPoint"; - exitPoint = "ExitPoint"; - region = "Region"; - state = "State"; - stateMachine = "StateMachine"; - stateNode = "StateNode"; - synchronization = "Synchronization"; - trigger = "Trigger"; - } + public const string ENTRYPOINT = "EntryPoint"; + public const string EXITPOINT = "ExitPoint"; + public const string REGION = "Region"; + public const string STATE = "State"; + public const string STATEMACHINE = "StateMachine"; + public const string STATENODE = "StateNode"; + public const string SYNCHRONIZATION = "Synchronization"; + public const string TRIGGER = "Trigger"; } + } diff --git a/MTIP/Constants/StereotypeConstants.cs b/MTIP/Constants/StereotypeConstants.cs index d35c7c8..dd77a27 100644 --- a/MTIP/Constants/StereotypeConstants.cs +++ b/MTIP/Constants/StereotypeConstants.cs @@ -8,103 +8,51 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class StereotypeConstants + public static class StereotypeConstants { - // Block Stereotypes - public string adjunctProperty; - public string allocated; - public string block; - public string boundReference; - public string businessRequirement; - public string classification; - public string classifierBehaviorProperty; - public string constraintBlock; - public string constraintBlockCap; - public string constraintParameter; - public string constraintProperty; - public string datastore; - public string decision; - public string domain; - public string external; - public string flowPort; - public string flowProperty; - public string flowSpecification; - public string fork; - public string fullPort; - public string hardware; - public string input; - public string interfaceBlock; - public string join; - public string metaclass; - public string model; - public string navigationCell; - public string objectiveFunction; - public string objectStereotype; - public string output; - public string participantProperty; - public string partProperty; - public string profile; - public string property; - public string proxyPort; - public string stereotype; - public string subsystem; - public string system; - public string systemContext; - public string valueProperty; - public string valueType; - public StereotypeConstants() - { - //Block Stereotypes - constraintBlock = "constraintBlock"; - constraintBlockCap = "ConstraintBlock"; - input = "input"; - output = "output"; - navigationCell = "NavigationCell"; - stereotype = "stereotype"; - metaclass = "metaclass"; - valueType = "ValueType"; - property = "property"; - datastore = "datastore"; - block = "block"; - hardware = "hardware"; - boundReference = "BoundReference"; - valueProperty = "ValueProperty"; - participantProperty = "participantProperty"; - decision = "Decision"; - domain = "Domain"; - objectStereotype = "Object"; - constraintProperty = "constraintProperty"; - flowProperty = "FlowProperty"; - constraintParameter = "ConstraintParameter"; - classifierBehaviorProperty = "ClassifierBehaviorProperty"; - objectiveFunction = "objectiveFunction"; - interfaceBlock = "InterfaceBlock"; - system = "System"; - subsystem = "Subsystem"; - systemContext = "System context"; - businessRequirement = "BusinessRequirement"; - fork = "Fork"; - flowPort = "FlowPort"; - fullPort = "FullPort"; - proxyPort = "ProxyPort"; - flowSpecification = "flowSpecification"; - partProperty = "PartProperty"; - property = "property"; - classification = "Classification"; - allocated = "allocated"; - join = "Join"; - external = "External"; - model = "model"; - profile = "profile"; - adjunctProperty = "AdjunctProperty"; - } + //Block Stereotypes + public const string CONSTRAINTBLOCK = "constraintBlock"; + public const string CONSTRAINTBLOCKCAP = "ConstraintBlock"; + public const string INPUT = "input"; + public const string OUTPUT = "output"; + public const string NAVIGATIONCELL = "NavigationCell"; + public const string STEREOTYPE = "stereotype"; + public const string METACLASS = "metaclass"; + public const string VALUETYPE = "ValueType"; + public const string PROPERTY = "property"; + public const string DATASTORE = "datastore"; + public const string BLOCK = "block"; + public const string HARDWARE = "hardware"; + public const string BOUNDREFERENCE = "BoundReference"; + public const string VALUEPROPERTY = "ValueProperty"; + public const string PARTICIPANTPROPERTY = "participantProperty"; + public const string DECISION = "Decision"; + public const string DOMAIN = "Domain"; + public const string OBJECTSTEREOTYPE = "Object"; + public const string CONSTRAINTPROPERTY = "constraintProperty"; + public const string FLOWPROPERTY = "FlowProperty"; + public const string CONSTRAINTPARAMETER = "ConstraintParameter"; + public const string CLASSIFIERBEHAVIORPROPERTY = "ClassifierBehaviorProperty"; + public const string OBJECTIVEFUNCTION = "objectiveFunction"; + public const string INTERFACEBLOCK = "InterfaceBlock"; + public const string SYSTEM = "System"; + public const string SUBSYSTEM = "Subsystem"; + public const string SYSTEMCONTEXT = "System context"; + public const string BUSINESSREQUIREMENT = "BusinessRequirement"; + public const string FORK = "Fork"; + public const string FLOWPORT = "FlowPort"; + public const string FULLPORT = "FullPort"; + public const string PROXYPORT = "ProxyPort"; + public const string FLOWSPECIFICATION = "flowSpecification"; + public const string PARTPROPERTY = "PartProperty"; + public const string CLASSIFICATION = "Classification"; + public const string ALLOCATED = "allocated"; + public const string JOIN = "Join"; + public const string EXTERNAL = "External"; + public const string MODEL = "model"; + public const string PROFILE = "profile"; + public const string ADJUNCTPROPERTY = "AdjunctProperty"; } } diff --git a/MTIP/Constants/SysmlConstants.cs b/MTIP/Constants/SysmlConstants.cs index 60c7f1e..4fa8d9f 100644 --- a/MTIP/Constants/SysmlConstants.cs +++ b/MTIP/Constants/SysmlConstants.cs @@ -8,15 +8,9 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class SysmlConstants + public static class SysmlConstants { //Categorization constants public static string DIAGRAM = "Diagram"; diff --git a/MTIP/Constants/UseCaseConstants.cs b/MTIP/Constants/UseCaseConstants.cs index e553668..8030ff4 100644 --- a/MTIP/Constants/UseCaseConstants.cs +++ b/MTIP/Constants/UseCaseConstants.cs @@ -7,22 +7,13 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class UseCaseConstants + + public static class UseCaseConstants { - public string actor; - public string useCase; - public UseCaseConstants() - { - actor = "Actor"; - useCase = "UseCase"; - } + public const string ACTOR = "Actor"; + public const string USECASE = "UseCase"; } } + diff --git a/MTIP/Translations/MTIPExportFunctions.cs b/MTIP/Translations/MTIPExportFunctions.cs index f2dc5bf..ad85f80 100644 --- a/MTIP/Translations/MTIPExportFunctions.cs +++ b/MTIP/Translations/MTIPExportFunctions.cs @@ -28,9 +28,6 @@ public class MTIPExportFunctions private string outputDirectory; public Dictionary profilePackages; public List exportLog; - - public StereotypeConstants stereotypeConstants; - public Dictionary customProfiles; public MTIPExportFunctions(MTIP plugin) @@ -38,9 +35,6 @@ public MTIPExportFunctions(MTIP plugin) repository = plugin.GetRepository(); profilePackages = new Dictionary(); exportLog = new List(); - - stereotypeConstants = new StereotypeConstants(); - customProfiles = new Dictionary(); } public void ExportToMTIPXML() @@ -969,11 +963,11 @@ public string GetPackageType(EA.Package package) { packageType = SysmlConstants.SYSMLMODEL; } - else if (package.Element.Stereotype == stereotypeConstants.model) + else if (package.Element.Stereotype == StereotypeConstants.MODEL) { packageType = SysmlConstants.SYSMLMODEL; } - else if (package.Element.Stereotype == stereotypeConstants.profile) + else if (package.Element.Stereotype == StereotypeConstants.PROFILE) { packageType = SysmlConstants.SYSMLPROFILE; if (!profilePackages.ContainsKey(package.Name)) profilePackages.Add(package.Name, package); @@ -1089,32 +1083,30 @@ public void CreateOpaqueNode(XmlDocument xmlDocument, string opaqueGuid, string } private string GetSysMLType(string type, string stereotype, int subtype, string metatype) { - StereotypeConstants stereotypeConstants = new StereotypeConstants(); - string elementType = ""; - if (stereotype == stereotypeConstants.block) elementType = SysmlConstants.SYSMLBLOCK; - else if (stereotype == stereotypeConstants.hardware) elementType = SysmlConstants.SYSMLBLOCK; - else if (stereotype == stereotypeConstants.boundReference) elementType = SysmlConstants.SYSMLBOUNDREFERENCE; - else if (stereotype == stereotypeConstants.valueProperty) elementType = SysmlConstants.SYSMLVALUEPROPERTY; - else if (stereotype == stereotypeConstants.participantProperty) elementType = SysmlConstants.SYSMLPARTICIPANTPROPERTY; - else if (stereotype == stereotypeConstants.decision) elementType = SysmlConstants.SYSMLDECISIONNODE; - else if (stereotype == stereotypeConstants.domain) elementType = SysmlConstants.SYSMLBLOCK; - else if (stereotype == stereotypeConstants.objectStereotype) elementType = SysmlConstants.SYSMLOBJECT; - else if (stereotype == stereotypeConstants.constraintProperty) elementType = SysmlConstants.SYSMLCONSTRAINTPROPERTY; - else if (stereotype == stereotypeConstants.valueType) elementType = SysmlConstants.SYSMLVALUEPROPERTY; - else if (stereotype == stereotypeConstants.flowProperty) elementType = SysmlConstants.SYSMLFLOWPROPERTY; - else if (stereotype == stereotypeConstants.constraintParameter) elementType = SysmlConstants.SYSMLCONSTRAINTPARAMETER; - else if (stereotype == stereotypeConstants.constraintBlock || stereotype == stereotypeConstants.constraintBlockCap) elementType = SysmlConstants.SYSMLCONSTRAINTBLOCK; - else if (stereotype == stereotypeConstants.classifierBehaviorProperty) elementType = SysmlConstants.SYSMLCLASSIFIERBEHAVIORPROPERTY; - else if (stereotype == stereotypeConstants.stereotype) elementType = SysmlConstants.SYSMLSTEREOTYPE; - else if (stereotype == stereotypeConstants.objectiveFunction) elementType = SysmlConstants.SYSMLOBJECTIVEFUNCTION; - else if (stereotype == stereotypeConstants.metaclass && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLMETACLASS; + if (stereotype == StereotypeConstants.BLOCK) elementType = SysmlConstants.SYSMLBLOCK; + else if (stereotype == StereotypeConstants.HARDWARE) elementType = SysmlConstants.SYSMLBLOCK; + else if (stereotype == StereotypeConstants.BOUNDREFERENCE) elementType = SysmlConstants.SYSMLBOUNDREFERENCE; + else if (stereotype == StereotypeConstants.VALUEPROPERTY) elementType = SysmlConstants.SYSMLVALUEPROPERTY; + else if (stereotype == StereotypeConstants.PARTICIPANTPROPERTY) elementType = SysmlConstants.SYSMLPARTICIPANTPROPERTY; + else if (stereotype == StereotypeConstants.DECISION) elementType = SysmlConstants.SYSMLDECISIONNODE; + else if (stereotype == StereotypeConstants.DOMAIN) elementType = SysmlConstants.SYSMLBLOCK; + else if (stereotype == StereotypeConstants.OBJECTSTEREOTYPE) elementType = SysmlConstants.SYSMLOBJECT; + else if (stereotype == StereotypeConstants.CONSTRAINTPROPERTY) elementType = SysmlConstants.SYSMLCONSTRAINTPROPERTY; + else if (stereotype == StereotypeConstants.VALUETYPE) elementType = SysmlConstants.SYSMLVALUEPROPERTY; + else if (stereotype == StereotypeConstants.FLOWPROPERTY) elementType = SysmlConstants.SYSMLFLOWPROPERTY; + else if (stereotype == StereotypeConstants.CONSTRAINTPARAMETER) elementType = SysmlConstants.SYSMLCONSTRAINTPARAMETER; + else if (stereotype == StereotypeConstants.CONSTRAINTBLOCK || stereotype == StereotypeConstants.CONSTRAINTBLOCKCAP) elementType = SysmlConstants.SYSMLCONSTRAINTBLOCK; + else if (stereotype == StereotypeConstants.CLASSIFIERBEHAVIORPROPERTY) elementType = SysmlConstants.SYSMLCLASSIFIERBEHAVIORPROPERTY; + else if (stereotype == StereotypeConstants.STEREOTYPE) elementType = SysmlConstants.SYSMLSTEREOTYPE; + else if (stereotype == StereotypeConstants.OBJECTIVEFUNCTION) elementType = SysmlConstants.SYSMLOBJECTIVEFUNCTION; + else if (stereotype == StereotypeConstants.METACLASS && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLMETACLASS; else if (stereotype == "" && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLCLASS; - else if (stereotype != "" && stereotype != stereotypeConstants.metaclass && stereotype != stereotypeConstants.stereotype && stereotype != stereotypeConstants.interfaceBlock - && stereotype != stereotypeConstants.domain && stereotype != stereotypeConstants.external && stereotype != stereotypeConstants.system && stereotype != stereotypeConstants.subsystem - && stereotype != stereotypeConstants.systemContext && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLCLASS; - else if (stereotype == stereotypeConstants.valueType && type != SysmlConstants.ENUMERATION) elementType = SysmlConstants.SYSMLVALUEPROPERTY; - else if (stereotype == stereotypeConstants.valueType && type == SysmlConstants.ENUMERATION) elementType = SysmlConstants.SYSMLENUMERATION; + else if (stereotype != "" && stereotype != StereotypeConstants.METACLASS && stereotype != StereotypeConstants.STEREOTYPE && stereotype != StereotypeConstants.INTERFACEBLOCK + && stereotype != StereotypeConstants.DOMAIN && stereotype != StereotypeConstants.EXTERNAL && stereotype != StereotypeConstants.SYSTEM && stereotype != StereotypeConstants.SUBSYSTEM + && stereotype != StereotypeConstants.SYSTEMCONTEXT && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLCLASS; + else if (stereotype == StereotypeConstants.VALUETYPE && type != SysmlConstants.ENUMERATION) elementType = SysmlConstants.SYSMLVALUEPROPERTY; + else if (stereotype == StereotypeConstants.VALUETYPE && type == SysmlConstants.ENUMERATION) elementType = SysmlConstants.SYSMLENUMERATION; else if (type == SysmlConstants.ACTIVITY) elementType = SysmlConstants.SYSMLACTIVITY; else if (type == SysmlConstants.ACTIVITYPARAMETER) elementType = SysmlConstants.SYSMLACTIVITYPARAMETERNODE; else if (type == SysmlConstants.ACTIVITYPARTITION) elementType = SysmlConstants.SYSMLACTIVITYPARTITION; @@ -1132,7 +1124,7 @@ private string GetSysMLType(string type, string stereotype, int subtype, string else if (type == SysmlConstants.EXITPOINT) elementType = SysmlConstants.SYSMLEXITPOINT; else if (type == SysmlConstants.SEQUENCE) elementType = SysmlConstants.SYSMLLIFELINE; else if (type == SysmlConstants.REGION) elementType = SysmlConstants.SYSMLREGION; - else if (type == SysmlConstants.REQUIREMENT && stereotype == stereotypeConstants.businessRequirement) elementType = SysmlConstants.SYSMLREQUIREMENT; + else if (type == SysmlConstants.REQUIREMENT && stereotype == StereotypeConstants.BUSINESSREQUIREMENT) elementType = SysmlConstants.SYSMLREQUIREMENT; else if (type == SysmlConstants.REQUIREMENT) elementType = SysmlConstants.SYSMLREQUIREMENT; else if (type == SysmlConstants.EXTENDEDREQUIREMENT) elementType = SysmlConstants.SYSMLEXTENDEDREQUIREMENT; else if (type == SysmlConstants.FUNCTIONALREQUIREMENT) elementType = SysmlConstants.SYSMLFUNCTIONALREQUIREMENT; @@ -1148,24 +1140,24 @@ private string GetSysMLType(string type, string stereotype, int subtype, string else if (type == SysmlConstants.OBJECT) elementType = SysmlConstants.SYSMLOBJECT; else if (type == SysmlConstants.OBJECTNODE) elementType = SysmlConstants.SYSMLOBJECTNODE; else if (type == SysmlConstants.USECASE) elementType = SysmlConstants.SYSMLUSECASE; - else if (type == SysmlConstants.OBJECT && stereotype == stereotypeConstants.datastore) elementType = SysmlConstants.SYSMLDATASTORENODE; - else if (type == SysmlConstants.SYNCHRONIZATION && stereotype == stereotypeConstants.fork) elementType = SysmlConstants.SYSMLFORKNODE; + else if (type == SysmlConstants.OBJECT && stereotype == StereotypeConstants.DATASTORE) elementType = SysmlConstants.SYSMLDATASTORENODE; + else if (type == SysmlConstants.SYNCHRONIZATION && stereotype == StereotypeConstants.FORK) elementType = SysmlConstants.SYSMLFORKNODE; else if (type == SysmlConstants.PORT) { - if (stereotype == stereotypeConstants.flowPort) elementType = SysmlConstants.SYSMLFLOWPORT; - else if (stereotype == stereotypeConstants.fullPort) elementType = SysmlConstants.SYSMLFULLPORT; - else if (stereotype == stereotypeConstants.proxyPort) elementType = SysmlConstants.SYSMLPROXYPORT; + if (stereotype == StereotypeConstants.FLOWPORT) elementType = SysmlConstants.SYSMLFLOWPORT; + else if (stereotype == StereotypeConstants.FULLPORT) elementType = SysmlConstants.SYSMLFULLPORT; + else if (stereotype == StereotypeConstants.PROXYPORT) elementType = SysmlConstants.SYSMLPROXYPORT; else { elementType = SysmlConstants.SYSMLPORT; } } - else if (stereotype == stereotypeConstants.interfaceBlock) elementType = SysmlConstants.SYSMLINTERFACEBLOCK; - else if (type == SysmlConstants.INTERFACE && stereotype != stereotypeConstants.flowSpecification) elementType = SysmlConstants.SYSMLINTERFACE; + else if (stereotype == StereotypeConstants.INTERFACEBLOCK) elementType = SysmlConstants.SYSMLINTERFACEBLOCK; + else if (type == SysmlConstants.INTERFACE && stereotype != StereotypeConstants.FLOWSPECIFICATION) elementType = SysmlConstants.SYSMLINTERFACE; else if (type == SysmlConstants.ACTIVITYPARAMETER) elementType = SysmlConstants.SYSMLACTIVITYPARAMETER; else if (type == SysmlConstants.ARTIFACT) elementType = SysmlConstants.SYSMLARTIFACT; else if (type == SysmlConstants.TRIGGER) elementType = SysmlConstants.SYSMLTRIGGER; - else if (type == SysmlConstants.TEXT && stereotype == stereotypeConstants.navigationCell) elementType = SysmlConstants.EANAVIGATIONCELL; + else if (type == SysmlConstants.TEXT && stereotype == StereotypeConstants.NAVIGATIONCELL) elementType = SysmlConstants.EANAVIGATIONCELL; else if (type == SysmlConstants.TEXT) elementType = SysmlConstants.SYSMLTEXT; else if (type == SysmlConstants.NOTE) elementType = SysmlConstants.SYSMLNOTE; else if (type == SysmlConstants.STATENODE) @@ -1189,19 +1181,19 @@ private string GetSysMLType(string type, string stereotype, int subtype, string else if (type == SysmlConstants.PART) { if (stereotype == "") elementType = SysmlConstants.SYSMLPARTPROPERTY; - else if (stereotype == stereotypeConstants.partProperty) elementType = SysmlConstants.SYSMLPARTPROPERTY; - else if (stereotype == stereotypeConstants.property) elementType = SysmlConstants.SYSMLPARTPROPERTY; - else if (stereotype == stereotypeConstants.constraintProperty) elementType = SysmlConstants.SYSMLCONSTRAINTPROPERTY; - else if (stereotype == stereotypeConstants.classification) elementType = SysmlConstants.SYSMLCLASSIFICATION; + else if (stereotype == StereotypeConstants.PARTPROPERTY) elementType = SysmlConstants.SYSMLPARTPROPERTY; + else if (stereotype == StereotypeConstants.PROPERTY) elementType = SysmlConstants.SYSMLPARTPROPERTY; + else if (stereotype == StereotypeConstants.CONSTRAINTPROPERTY) elementType = SysmlConstants.SYSMLCONSTRAINTPROPERTY; + else if (stereotype == StereotypeConstants.CLASSIFICATION) elementType = SysmlConstants.SYSMLCLASSIFICATION; } else if (type == SysmlConstants.REQUIREDINTERFACE) elementType = SysmlConstants.SYSMLREQUIREDINTERFACE; else if (type == SysmlConstants.NOTE) elementType = SysmlConstants.SYSMLNOTE; else if (type == SysmlConstants.PACKAGE) elementType = SysmlConstants.SYSMLPACKAGE; - else if (stereotype == stereotypeConstants.allocated || type == SysmlConstants.ACTION || type == SysmlConstants.ACTIVITYPARAMETER || + else if (stereotype == StereotypeConstants.ALLOCATED || type == SysmlConstants.ACTION || type == SysmlConstants.ACTIVITYPARAMETER || type == SysmlConstants.ACTIONPIN || type == SysmlConstants.EVENT) { - if (stereotype == stereotypeConstants.allocated) elementType = SysmlConstants.SYSMLALLOCATED; + if (stereotype == StereotypeConstants.ALLOCATED) elementType = SysmlConstants.SYSMLALLOCATED; else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.acceptEventAction) elementType = SysmlConstants.SYSMLACCEPTEVENTACTION; else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.callBehaviorAction) elementType = SysmlConstants.SYSMLCALLBEHAVIORACTION; else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.createObjectAction) elementType = SysmlConstants.SYSMLCREATEOBJECTACTION; @@ -1211,8 +1203,8 @@ private string GetSysMLType(string type, string stereotype, int subtype, string else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.sendSignalAction) elementType = SysmlConstants.SYSMLSENDSIGNALACTION; else if (type == SysmlConstants.ACTION) elementType = SysmlConstants.SYSMLACTION; else if (type == SysmlConstants.ACTIVITYPARAMETER) elementType = SysmlConstants.SYSMLACTIVITYPARAMETER; - else if (type == SysmlConstants.ACTIONPIN && (stereotype == stereotypeConstants.output || metatype == MetatypeConstants.outputPin)) elementType = SysmlConstants.SYSMLOUTPUTPIN; - else if (type == SysmlConstants.ACTIONPIN && (stereotype == stereotypeConstants.input || metatype == MetatypeConstants.inputPin)) elementType = SysmlConstants.SYSMLINPUTPIN; + else if (type == SysmlConstants.ACTIONPIN && (stereotype == StereotypeConstants.OUTPUT || metatype == MetatypeConstants.outputPin)) elementType = SysmlConstants.SYSMLOUTPUTPIN; + else if (type == SysmlConstants.ACTIONPIN && (stereotype == StereotypeConstants.INPUT || metatype == MetatypeConstants.inputPin)) elementType = SysmlConstants.SYSMLINPUTPIN; else if (type == SysmlConstants.ACTIONPIN) elementType = SysmlConstants.SYSMLACTIONPIN; else if (type == SysmlConstants.EVENT) { @@ -1224,13 +1216,13 @@ private string GetSysMLType(string type, string stereotype, int subtype, string else if (type == SysmlConstants.MERGENODE) elementType = SysmlConstants.SYSMLMERGENODE; else if (type == SysmlConstants.SYNCHRONIZATION) { - if (stereotype == stereotypeConstants.join) elementType = SysmlConstants.SYSMLJOIN; - else if (stereotype == stereotypeConstants.fork) elementType = SysmlConstants.SYSMLFORK; + if (stereotype == StereotypeConstants.JOIN) elementType = SysmlConstants.SYSMLJOIN; + else if (stereotype == StereotypeConstants.FORK) elementType = SysmlConstants.SYSMLFORK; else elementType = SysmlConstants.SYSMLSYNCHRONIZATION; } else if (type == SysmlConstants.INTERRUPTIBLEACTIVITYREGION) elementType = SysmlConstants.SYSMLINTERRUPTIBLEACTIVITYREGION; - else if (stereotype == stereotypeConstants.flowSpecification) elementType = SysmlConstants.SYSMLFLOWSPECIFICATION; - else if (stereotype == stereotypeConstants.external || stereotype == stereotypeConstants.subsystem || stereotype == stereotypeConstants.system || stereotype == stereotypeConstants.systemContext) elementType = SysmlConstants.SYSMLBLOCK; + else if (stereotype == StereotypeConstants.FLOWSPECIFICATION) elementType = SysmlConstants.SYSMLFLOWSPECIFICATION; + else if (stereotype == StereotypeConstants.EXTERNAL || stereotype == StereotypeConstants.SUBSYSTEM || stereotype == StereotypeConstants.SYSTEM || stereotype == StereotypeConstants.SYSTEMCONTEXT) elementType = SysmlConstants.SYSMLBLOCK; return elementType; } public string GetDiagramSysMLType(EA.Diagram diagram) diff --git a/MTIP/Translations/MTIPImportFunctions.cs b/MTIP/Translations/MTIPImportFunctions.cs index 7c95789..ab57cca 100644 --- a/MTIP/Translations/MTIPImportFunctions.cs +++ b/MTIP/Translations/MTIPImportFunctions.cs @@ -749,7 +749,6 @@ internal void AddElementElement(string parentId, string childId) } internal void GetElement(EA.Element childElement, XmlItem childItem, string childId, string parentType) { - StereotypeConstants stereotypeConstants = new StereotypeConstants(); if (childElement.Type == SysmlConstants.STATENODE) { if (childItem.GetElementType() == SysmlConstants.INITIALPSEUDOSTATE) childElement.Subtype = 3; @@ -783,22 +782,22 @@ internal void GetElement(EA.Element childElement, XmlItem childItem, string chil } if (childElement.Type == SysmlConstants.ACTIONPIN) { - if (childItem.GetElementType() == SysmlConstants.INPUTPIN) childElement.Stereotype = stereotypeConstants.input; - if (childItem.GetElementType() == SysmlConstants.OUTPUTPIN) childElement.Stereotype = stereotypeConstants.output; + if (childItem.GetElementType() == SysmlConstants.INPUTPIN) childElement.Stereotype = StereotypeConstants.INPUT; + if (childItem.GetElementType() == SysmlConstants.OUTPUTPIN) childElement.Stereotype = StereotypeConstants.OUTPUT; } - if (childItem.GetElementType() == SysmlConstants.NAVIGATIONCELL) childElement.Stereotype = stereotypeConstants.navigationCell; - if (childItem.GetElementType() == SysmlConstants.STEREOTYPE) childElement.Stereotype = stereotypeConstants.stereotype; - if (childItem.GetElementType() == SysmlConstants.METACLASS) childElement.Stereotype = stereotypeConstants.metaclass; - if (childItem.GetElementType() == SysmlConstants.VALUEPROPERTY) childElement.Stereotype = stereotypeConstants.valueType; + if (childItem.GetElementType() == SysmlConstants.NAVIGATIONCELL) childElement.Stereotype = StereotypeConstants.NAVIGATIONCELL; + if (childItem.GetElementType() == SysmlConstants.STEREOTYPE) childElement.Stereotype = StereotypeConstants.STEREOTYPE; + if (childItem.GetElementType() == SysmlConstants.METACLASS) childElement.Stereotype = StereotypeConstants.METACLASS; + if (childItem.GetElementType() == SysmlConstants.VALUEPROPERTY) childElement.Stereotype = StereotypeConstants.VALUETYPE; if (childItem.GetElementType() == SysmlConstants.PARTPROPERTY) { - childElement.Stereotype = stereotypeConstants.property; + childElement.Stereotype = StereotypeConstants.PROPERTY; } if (childElement.Type == SysmlConstants.OBJECT) { - if (childItem.GetElementType() == SysmlConstants.DATASTORENODE) childElement.Stereotype = stereotypeConstants.datastore; + if (childItem.GetElementType() == SysmlConstants.DATASTORENODE) childElement.Stereotype = StereotypeConstants.DATASTORE; } if (childElement.Type == SysmlConstants.STATE && childItem.GetAttributes().ContainsKey(AttributeConstants.SUBMACHINE)) @@ -849,7 +848,7 @@ internal void GetElement(EA.Element childElement, XmlItem childItem, string chil } if (childItem.GetAttributes().ContainsKey(AttributeConstants.STEREOTYPE)) { - if (childItem.GetElementType() == SysmlConstants.STEREOTYPE) childElement.Stereotype = stereotypeConstants.stereotype; + if (childItem.GetElementType() == SysmlConstants.STEREOTYPE) childElement.Stereotype = StereotypeConstants.STEREOTYPE; else { childElement.Stereotype = childItem.GetAttribute(AttributeConstants.STEREOTYPE); @@ -1804,9 +1803,6 @@ public bool IsPortType(string type) } internal string GetEAType(string sysmlType, string stereotype) { - StereotypeConstants stereotypeConstants = new StereotypeConstants(); - UseCaseConstants useCaseConstants = new UseCaseConstants(); - StateMachineConstants stateMachineConstants = new StateMachineConstants(); string type = ""; if (sysmlType == SysmlConstants.ACTIVITY) type = ActivityConstants.ACTIVITY; else if (sysmlType == SysmlConstants.ACTIVITYFINALNODE) type = ActivityConstants.STATENODE; @@ -1814,14 +1810,14 @@ internal string GetEAType(string sysmlType, string stereotype) else if (sysmlType == SysmlConstants.ACTIVITYPARTITION) type = ActivityConstants.ACTIVITYPARTION; else if (sysmlType == SysmlConstants.BLOCK) { - if (stereotype == stereotypeConstants.constraintBlockCap || stereotype == stereotypeConstants.constraintBlock) type = BlockConstants.CONSTRAINTBLOCK; + if (stereotype == StereotypeConstants.CONSTRAINTBLOCKCAP || stereotype == StereotypeConstants.CONSTRAINTBLOCK) type = BlockConstants.CONSTRAINTBLOCK; else type = BlockConstants.BLOCK; } else if (sysmlType == SysmlConstants.ACCEPTEVENTACTION) type = ActivityConstants.ACCEPTEVENTACTION; else if (sysmlType == SysmlConstants.ACTION) type = ActivityConstants.ACTION; else if (sysmlType == SysmlConstants.ACTIONPIN) type = ActivityConstants.ACTIONPIN; else if (sysmlType == SysmlConstants.ACTIVITYINITIALNODE) type = ActivityConstants.STATENODE; - else if (sysmlType == SysmlConstants.ACTOR) type = useCaseConstants.actor; + else if (sysmlType == SysmlConstants.ACTOR) type = UseCaseConstants.ACTOR; else if (sysmlType == SysmlConstants.ASSOCIATIONBLOCK) type = BlockConstants.ASSOCIATION; else if (sysmlType == SysmlConstants.BOUNDREFERENCE) type = InternalBlockConstants.BOUNDREFERENCE; else if (sysmlType == SysmlConstants.BOUNDARY) type = InternalBlockConstants.BOUNDARY; @@ -1844,16 +1840,16 @@ internal string GetEAType(string sysmlType, string stereotype) else if (sysmlType == SysmlConstants.CREATEOBJECTACTION) type = ActivityConstants.CREATEOBJECTACTION; else if (sysmlType == SysmlConstants.DATASTORENODE) type = ProfileConstants.OBJECTTYPE; else if (sysmlType == SysmlConstants.DECISIONNODE) type = ActivityConstants.DECISION; - else if (sysmlType == SysmlConstants.DEEPHISTORY) type = stateMachineConstants.stateNode; + else if (sysmlType == SysmlConstants.DEEPHISTORY) type = StateMachineConstants.STATENODE; else if (sysmlType == SysmlConstants.DESIGNCONSTRAINT) type = RequirementConstants.DESIGNCONSTRAINT; else if (sysmlType == SysmlConstants.DESTROYOBJECTACTION) type = ActivityConstants.DESTROYOBJECTACTION; else if (sysmlType == SysmlConstants.DOMAIN) type = BlockConstants.BLOCK; - else if (sysmlType == SysmlConstants.ENTRYPOINT) type = stateMachineConstants.entryPoint; + else if (sysmlType == SysmlConstants.ENTRYPOINT) type = StateMachineConstants.ENTRYPOINT; else if (sysmlType == SysmlConstants.ENUMERATION) type = BlockConstants.ENUMERATION; else if (sysmlType == SysmlConstants.EVENT) type = ActivityConstants.EVENTTYPE; else if (sysmlType == SysmlConstants.EXCEPTIONHANDLER) type = ProfileConstants.EXCEPTIONHANDLER; else if (sysmlType == SysmlConstants.EXTENDEDREQUIREMENT) type = RequirementConstants.EXTENDEDREQUIREMENT; - else if (sysmlType == SysmlConstants.EXITPOINT) type = stateMachineConstants.exitPoint; + else if (sysmlType == SysmlConstants.EXITPOINT) type = StateMachineConstants.EXITPOINT; else if (sysmlType == SysmlConstants.EXTERNAL) type = BlockConstants.EXTERNAL; else if (sysmlType == SysmlConstants.LIFELINE) type = SequenceConstants.SEQUENCE; else if (sysmlType == SysmlConstants.PACKAGE) type = ProfileConstants.PACKAGE; @@ -1876,7 +1872,7 @@ internal string GetEAType(string sysmlType, string stereotype) else if (sysmlType == SysmlConstants.INSTANCESPECIFICATION) type = ProfileConstants.OBJECTTYPE; else if (sysmlType == SysmlConstants.INTERRUPTIBLEACTIVITYREGION) type = ActivityConstants.INTERRUPTIBLEACTIVITYREGION; else if (sysmlType == SysmlConstants.MERGENODE) type = ActivityConstants.MERGENODE; - else if (sysmlType == SysmlConstants.METACLASS) type = stereotypeConstants.metaclass; + else if (sysmlType == SysmlConstants.METACLASS) type = StereotypeConstants.METACLASS; else if (sysmlType == SysmlConstants.NAVIGATIONCELL) type = ProfileConstants.TEXT; else if (sysmlType == SysmlConstants.NOTE) type = ProfileConstants.NOTE; else if (sysmlType == SysmlConstants.OBJECT) type = ProfileConstants.OBJECTTYPE; @@ -1885,37 +1881,37 @@ internal string GetEAType(string sysmlType, string stereotype) else if (sysmlType == SysmlConstants.OPERATION) type = BlockConstants.OPERATION; else if (sysmlType == SysmlConstants.OPAQUEACTION) type = ActivityConstants.ACTION; else if (sysmlType == SysmlConstants.OUTPUTPIN) type = ActivityConstants.ACTIONPIN; - else if (sysmlType == SysmlConstants.JOIN) type = stateMachineConstants.synchronization; + else if (sysmlType == SysmlConstants.JOIN) type = StateMachineConstants.SYNCHRONIZATION; else if (sysmlType == SysmlConstants.JOINNODE) type = ActivityConstants.SYNCHRONIZATION; - else if (sysmlType == SysmlConstants.FORK) type = stateMachineConstants.synchronization; + else if (sysmlType == SysmlConstants.FORK) type = StateMachineConstants.SYNCHRONIZATION; else if (sysmlType == SysmlConstants.FLOWPROPERTY) type = InternalBlockConstants.FLOWPROPERTY; else if (sysmlType == SysmlConstants.FORKNODE) type = ActivityConstants.SYNCHRONIZATION; else if (sysmlType == SysmlConstants.VALUEPROPERTY) type = BlockConstants.DATATYPE; else if (sysmlType == SysmlConstants.PARTPROPERTY) type = BlockConstants.PROPERTY; else if (sysmlType == SysmlConstants.REFERENCEPROPERTY) type = InternalBlockConstants.REFERENCEPROPERTY; else if (sysmlType == SysmlConstants.REQUIREMENT) type = RequirementConstants.REQUIREMENT; - else if (sysmlType == SysmlConstants.REGION) type = stateMachineConstants.region; + else if (sysmlType == SysmlConstants.REGION) type = StateMachineConstants.REGION; else if (sysmlType == SysmlConstants.CONSTRAINTPROPERTY) type = InternalBlockConstants.CONSTRAINTPROPERTY; else if (sysmlType == SysmlConstants.PARTICIPANTPROPERTY) type = InternalBlockConstants.PARTICIPANTPROPERTY; else if (sysmlType == SysmlConstants.PERFORMANCEREQUIREMENT) type = RequirementConstants.PERFORMANCEREQUIREMENT; else if (sysmlType == SysmlConstants.PHYSICALREQUIREMENT) type = RequirementConstants.PHYSICALREQUIREMENT; else if (sysmlType == SysmlConstants.PORT) type = BlockConstants.PORT; else if (sysmlType == SysmlConstants.SENDSIGNALACTION) type = ActivityConstants.SENDSIGNALACTION; - else if (sysmlType == SysmlConstants.SHALLOWHISTORY) type = stateMachineConstants.stateNode; + else if (sysmlType == SysmlConstants.SHALLOWHISTORY) type = StateMachineConstants.STATENODE; else if (sysmlType == SysmlConstants.SIGNAL) type = BlockConstants.SIGNAL; else if (sysmlType == SysmlConstants.STEREOTYPE) type = ProfileConstants.CLASSTYPE; - else if (sysmlType == SysmlConstants.STATE) type = stateMachineConstants.state; + else if (sysmlType == SysmlConstants.STATE) type = StateMachineConstants.STATE; else if (sysmlType == SysmlConstants.STATEINVARIANT) type = SequenceConstants.INTERACTIONSTATE; - else if (sysmlType == SysmlConstants.STATEMACHINE) type = stateMachineConstants.stateMachine; + else if (sysmlType == SysmlConstants.STATEMACHINE) type = StateMachineConstants.STATEMACHINE; else if (sysmlType == SysmlConstants.SUBSYSTEM) type = BlockConstants.BLOCK; - else if (sysmlType == SysmlConstants.SYNCHRONIZATION) type = stateMachineConstants.synchronization; + else if (sysmlType == SysmlConstants.SYNCHRONIZATION) type = StateMachineConstants.SYNCHRONIZATION; else if (sysmlType == SysmlConstants.SYSTEM) type = BlockConstants.BLOCK; else if (sysmlType == SysmlConstants.SYSTEMCONTEXT) type = BlockConstants.BLOCK; - else if (sysmlType == SysmlConstants.TERMINATE) type = stateMachineConstants.stateNode; + else if (sysmlType == SysmlConstants.TERMINATE) type = StateMachineConstants.STATENODE; else if (sysmlType == SysmlConstants.TEXT) type = ProfileConstants.TEXT; - else if (sysmlType == SysmlConstants.TRIGGER) type = stateMachineConstants.trigger; + else if (sysmlType == SysmlConstants.TRIGGER) type = StateMachineConstants.TRIGGER; else if (sysmlType == SysmlConstants.UNIT) type = BlockConstants.UNIT; - else if (sysmlType == SysmlConstants.USECASE) type = useCaseConstants.useCase; + else if (sysmlType == SysmlConstants.USECASE) type = UseCaseConstants.USECASE; else if (sysmlType == SysmlConstants.QUANTITYKIND) type = BlockConstants.QUANTITYKIND; else if (sysmlType == SysmlConstants.VALUETYPE) type = BlockConstants.VALUETYPE; else if (sysmlType == SysmlConstants.FLOWSPECIFICATION) type = BlockConstants.INTERFACETYPE; @@ -1923,33 +1919,30 @@ internal string GetEAType(string sysmlType, string stereotype) } private string GetSysMLType(string type, string stereotype, int subtype, string metatype) { - StereotypeConstants stereotypeConstants = new StereotypeConstants(); - - string elementType = ""; - if (stereotype == stereotypeConstants.block) elementType = SysmlConstants.SYSMLBLOCK; - else if (stereotype == stereotypeConstants.hardware) elementType = SysmlConstants.SYSMLBLOCK; - else if (stereotype == stereotypeConstants.boundReference) elementType = SysmlConstants.SYSMLBOUNDREFERENCE; - else if (stereotype == stereotypeConstants.valueProperty) elementType = SysmlConstants.SYSMLVALUEPROPERTY; - else if (stereotype == stereotypeConstants.participantProperty) elementType = SysmlConstants.SYSMLPARTICIPANTPROPERTY; - else if (stereotype == stereotypeConstants.decision) elementType = SysmlConstants.SYSMLDECISIONNODE; - else if (stereotype == stereotypeConstants.domain) elementType = SysmlConstants.SYSMLBLOCK; - else if (stereotype == stereotypeConstants.objectStereotype) elementType = SysmlConstants.SYSMLOBJECT; - else if (stereotype == stereotypeConstants.constraintProperty) elementType = SysmlConstants.SYSMLCONSTRAINTPROPERTY; - else if (stereotype == stereotypeConstants.valueType) elementType = SysmlConstants.SYSMLVALUEPROPERTY; - else if (stereotype == stereotypeConstants.flowProperty) elementType = SysmlConstants.SYSMLFLOWPROPERTY; - else if (stereotype == stereotypeConstants.constraintParameter) elementType = SysmlConstants.SYSMLCONSTRAINTPARAMETER; - else if (stereotype == stereotypeConstants.constraintBlock || stereotype == stereotypeConstants.constraintBlockCap) elementType = SysmlConstants.SYSMLCONSTRAINTBLOCK; - else if (stereotype == stereotypeConstants.classifierBehaviorProperty) elementType = SysmlConstants.SYSMLCLASSIFIERBEHAVIORPROPERTY; - else if (stereotype == stereotypeConstants.stereotype) elementType = SysmlConstants.SYSMLSTEREOTYPE; - else if (stereotype == stereotypeConstants.objectiveFunction) elementType = SysmlConstants.SYSMLOBJECTIVEFUNCTION; - else if (stereotype == stereotypeConstants.metaclass && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLMETACLASS; + if (stereotype == StereotypeConstants.BLOCK) elementType = SysmlConstants.SYSMLBLOCK; + else if (stereotype == StereotypeConstants.HARDWARE) elementType = SysmlConstants.SYSMLBLOCK; + else if (stereotype == StereotypeConstants.BOUNDREFERENCE) elementType = SysmlConstants.SYSMLBOUNDREFERENCE; + else if (stereotype == StereotypeConstants.VALUEPROPERTY) elementType = SysmlConstants.SYSMLVALUEPROPERTY; + else if (stereotype == StereotypeConstants.PARTICIPANTPROPERTY) elementType = SysmlConstants.SYSMLPARTICIPANTPROPERTY; + else if (stereotype == StereotypeConstants.DECISION) elementType = SysmlConstants.SYSMLDECISIONNODE; + else if (stereotype == StereotypeConstants.DOMAIN) elementType = SysmlConstants.SYSMLBLOCK; + else if (stereotype == StereotypeConstants.OBJECTSTEREOTYPE) elementType = SysmlConstants.SYSMLOBJECT; + else if (stereotype == StereotypeConstants.CONSTRAINTPROPERTY) elementType = SysmlConstants.SYSMLCONSTRAINTPROPERTY; + else if (stereotype == StereotypeConstants.VALUETYPE) elementType = SysmlConstants.SYSMLVALUEPROPERTY; + else if (stereotype == StereotypeConstants.FLOWPROPERTY) elementType = SysmlConstants.SYSMLFLOWPROPERTY; + else if (stereotype == StereotypeConstants.CONSTRAINTPARAMETER) elementType = SysmlConstants.SYSMLCONSTRAINTPARAMETER; + else if (stereotype == StereotypeConstants.CONSTRAINTBLOCK || stereotype == StereotypeConstants.CONSTRAINTBLOCKCAP) elementType = SysmlConstants.SYSMLCONSTRAINTBLOCK; + else if (stereotype == StereotypeConstants.CLASSIFIERBEHAVIORPROPERTY) elementType = SysmlConstants.SYSMLCLASSIFIERBEHAVIORPROPERTY; + else if (stereotype == StereotypeConstants.STEREOTYPE) elementType = SysmlConstants.SYSMLSTEREOTYPE; + else if (stereotype == StereotypeConstants.OBJECTIVEFUNCTION) elementType = SysmlConstants.SYSMLOBJECTIVEFUNCTION; + else if (stereotype == StereotypeConstants.METACLASS && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLMETACLASS; else if (stereotype == "" && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLCLASS; - else if (stereotype != "" && stereotype != stereotypeConstants.metaclass && stereotype != stereotypeConstants.stereotype && stereotype != stereotypeConstants.interfaceBlock - && stereotype != stereotypeConstants.domain && stereotype != stereotypeConstants.external && stereotype != stereotypeConstants.system && stereotype != stereotypeConstants.subsystem - && stereotype != stereotypeConstants.systemContext && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLCLASS; - else if (stereotype == stereotypeConstants.valueType && type != SysmlConstants.ENUMERATION) elementType = SysmlConstants.SYSMLVALUEPROPERTY; - else if (stereotype == stereotypeConstants.valueType && type == SysmlConstants.ENUMERATION) elementType = SysmlConstants.SYSMLENUMERATION; + else if (stereotype != "" && stereotype != StereotypeConstants.METACLASS && stereotype != StereotypeConstants.STEREOTYPE && stereotype != StereotypeConstants.INTERFACEBLOCK + && stereotype != StereotypeConstants.DOMAIN && stereotype != StereotypeConstants.EXTERNAL && stereotype != StereotypeConstants.SYSTEM && stereotype != StereotypeConstants.SUBSYSTEM + && stereotype != StereotypeConstants.SYSTEMCONTEXT && type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLCLASS; + else if (stereotype == StereotypeConstants.VALUETYPE && type != SysmlConstants.ENUMERATION) elementType = SysmlConstants.SYSMLVALUEPROPERTY; + else if (stereotype == StereotypeConstants.VALUETYPE && type == SysmlConstants.ENUMERATION) elementType = SysmlConstants.SYSMLENUMERATION; else if (type == SysmlConstants.ACTIVITY) elementType = SysmlConstants.SYSMLACTIVITY; else if (type == SysmlConstants.ACTIVITYPARAMETER) elementType = SysmlConstants.SYSMLACTIVITYPARAMETERNODE; else if (type == SysmlConstants.ACTIVITYPARTITION) elementType = SysmlConstants.SYSMLACTIVITYPARTITION; @@ -1967,7 +1960,7 @@ private string GetSysMLType(string type, string stereotype, int subtype, string else if (type == SysmlConstants.EXITPOINT) elementType = SysmlConstants.SYSMLEXITPOINT; else if (type == SysmlConstants.SEQUENCE) elementType = SysmlConstants.SYSMLLIFELINE; else if (type == SysmlConstants.REGION) elementType = SysmlConstants.SYSMLREGION; - else if (type == SysmlConstants.REQUIREMENT && stereotype == stereotypeConstants.businessRequirement) elementType = SysmlConstants.SYSMLREQUIREMENT; + else if (type == SysmlConstants.REQUIREMENT && stereotype == StereotypeConstants.BUSINESSREQUIREMENT) elementType = SysmlConstants.SYSMLREQUIREMENT; else if (type == SysmlConstants.REQUIREMENT) elementType = SysmlConstants.SYSMLREQUIREMENT; else if (type == SysmlConstants.EXTENDEDREQUIREMENT) elementType = SysmlConstants.SYSMLEXTENDEDREQUIREMENT; else if (type == SysmlConstants.FUNCTIONALREQUIREMENT) elementType = SysmlConstants.SYSMLFUNCTIONALREQUIREMENT; @@ -1983,24 +1976,24 @@ private string GetSysMLType(string type, string stereotype, int subtype, string else if (type == SysmlConstants.OBJECT) elementType = SysmlConstants.SYSMLOBJECT; else if (type == SysmlConstants.OBJECTNODE) elementType = SysmlConstants.SYSMLOBJECTNODE; else if (type == SysmlConstants.USECASE) elementType = SysmlConstants.SYSMLUSECASE; - else if (type == SysmlConstants.OBJECT && stereotype == stereotypeConstants.datastore) elementType = SysmlConstants.SYSMLDATASTORENODE; - else if (type == SysmlConstants.SYNCHRONIZATION && stereotype == stereotypeConstants.fork) elementType = SysmlConstants.SYSMLFORKNODE; + else if (type == SysmlConstants.OBJECT && stereotype == StereotypeConstants.DATASTORE) elementType = SysmlConstants.SYSMLDATASTORENODE; + else if (type == SysmlConstants.SYNCHRONIZATION && stereotype == StereotypeConstants.FORK) elementType = SysmlConstants.SYSMLFORKNODE; else if (type == SysmlConstants.PORT) { - if (stereotype == stereotypeConstants.flowPort) elementType = SysmlConstants.SYSMLFLOWPORT; - else if (stereotype == stereotypeConstants.fullPort) elementType = SysmlConstants.SYSMLFULLPORT; - else if (stereotype == stereotypeConstants.proxyPort) elementType = SysmlConstants.SYSMLPROXYPORT; + if (stereotype == StereotypeConstants.FLOWPORT) elementType = SysmlConstants.SYSMLFLOWPORT; + else if (stereotype == StereotypeConstants.FULLPORT) elementType = SysmlConstants.SYSMLFULLPORT; + else if (stereotype == StereotypeConstants.PROXYPORT) elementType = SysmlConstants.SYSMLPROXYPORT; else { elementType = SysmlConstants.SYSMLPORT; } } - else if (stereotype == stereotypeConstants.interfaceBlock) elementType = SysmlConstants.SYSMLINTERFACEBLOCK; - else if (type == SysmlConstants.INTERFACE && stereotype != stereotypeConstants.flowSpecification) elementType = SysmlConstants.SYSMLINTERFACE; + else if (stereotype == StereotypeConstants.INTERFACEBLOCK) elementType = SysmlConstants.SYSMLINTERFACEBLOCK; + else if (type == SysmlConstants.INTERFACE && stereotype != StereotypeConstants.FLOWSPECIFICATION) elementType = SysmlConstants.SYSMLINTERFACE; else if (type == SysmlConstants.ACTIVITYPARAMETER) elementType = SysmlConstants.SYSMLACTIVITYPARAMETER; else if (type == SysmlConstants.ARTIFACT) elementType = SysmlConstants.SYSMLARTIFACT; else if (type == SysmlConstants.TRIGGER) elementType = SysmlConstants.SYSMLTRIGGER; - else if (type == SysmlConstants.TEXT && stereotype == stereotypeConstants.navigationCell) elementType = SysmlConstants.EANAVIGATIONCELL; + else if (type == SysmlConstants.TEXT && stereotype == StereotypeConstants.NAVIGATIONCELL) elementType = SysmlConstants.EANAVIGATIONCELL; else if (type == SysmlConstants.TEXT) elementType = SysmlConstants.SYSMLTEXT; else if (type == SysmlConstants.NOTE) elementType = SysmlConstants.SYSMLNOTE; else if (type == SysmlConstants.STATENODE) @@ -2022,38 +2015,38 @@ private string GetSysMLType(string type, string stereotype, int subtype, string else if (type == SysmlConstants.CLASS) elementType = SysmlConstants.SYSMLCLASS; else if (type == SysmlConstants.STATEMACHINE) elementType = SysmlConstants.SYSMLSTATEMACHINE; else if (type == SysmlConstants.PART && stereotype == "") elementType = SysmlConstants.SYSMLPARTPROPERTY; - else if (type == SysmlConstants.PART && stereotype == stereotypeConstants.partProperty) elementType = SysmlConstants.SYSMLPARTPROPERTY; - else if (type == SysmlConstants.PART && stereotype == stereotypeConstants.property) elementType = SysmlConstants.SYSMLPARTPROPERTY; - else if (type == SysmlConstants.PART && stereotype == stereotypeConstants.constraintProperty) elementType = SysmlConstants.SYSMLCONSTRAINTPROPERTY; - else if (type == SysmlConstants.PART && stereotype == stereotypeConstants.classification) elementType = SysmlConstants.SYSMLCLASSIFICATION; + else if (type == SysmlConstants.PART && stereotype == StereotypeConstants.PARTPROPERTY) elementType = SysmlConstants.SYSMLPARTPROPERTY; + else if (type == SysmlConstants.PART && stereotype == StereotypeConstants.PROPERTY) elementType = SysmlConstants.SYSMLPARTPROPERTY; + else if (type == SysmlConstants.PART && stereotype == StereotypeConstants.CONSTRAINTPROPERTY) elementType = SysmlConstants.SYSMLCONSTRAINTPROPERTY; + else if (type == SysmlConstants.PART && stereotype == StereotypeConstants.CLASSIFICATION) elementType = SysmlConstants.SYSMLCLASSIFICATION; else if (type == SysmlConstants.REQUIREDINTERFACE) elementType = SysmlConstants.SYSMLREQUIREDINTERFACE; else if (type == SysmlConstants.NOTE) elementType = SysmlConstants.SYSMLNOTE; else if (type == SysmlConstants.PACKAGE) elementType = SysmlConstants.SYSMLPACKAGE; - else if (stereotype == stereotypeConstants.allocated || type == SysmlConstants.ACTION || type == SysmlConstants.ACTIVITYPARAMETER || + else if (stereotype == StereotypeConstants.ALLOCATED || type == SysmlConstants.ACTION || type == SysmlConstants.ACTIVITYPARAMETER || type == SysmlConstants.ACTIONPIN || type == SysmlConstants.EVENT) { - if (stereotype == stereotypeConstants.allocated) elementType = SysmlConstants.SYSMLALLOCATED; + if (stereotype == StereotypeConstants.ALLOCATED) elementType = SysmlConstants.SYSMLALLOCATED; else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.acceptEventAction) elementType = SysmlConstants.SYSMLACCEPTEVENTACTION; else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.callBehaviorAction) elementType = SysmlConstants.SYSMLCALLBEHAVIORACTION; else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.opaqueAction) elementType = SysmlConstants.SYSMLOPAQUEACTION; else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.sendSignalAction) elementType = SysmlConstants.SYSMLSENDSIGNALACTION; else if (type == SysmlConstants.ACTION) elementType = SysmlConstants.SYSMLACTION; else if (type == SysmlConstants.ACTIVITYPARAMETER) elementType = SysmlConstants.SYSMLACTIVITYPARAMETER; - else if (type == SysmlConstants.ACTIONPIN && stereotype == stereotypeConstants.output) elementType = SysmlConstants.SYSMLOUTPUTPIN; - else if (type == SysmlConstants.ACTIONPIN && stereotype == stereotypeConstants.input) elementType = SysmlConstants.SYSMLINPUTPIN; + else if (type == SysmlConstants.ACTIONPIN && stereotype == StereotypeConstants.OUTPUT) elementType = SysmlConstants.SYSMLOUTPUTPIN; + else if (type == SysmlConstants.ACTIONPIN && stereotype == StereotypeConstants.INPUT) elementType = SysmlConstants.SYSMLINPUTPIN; else if (type == SysmlConstants.ACTIONPIN) elementType = SysmlConstants.SYSMLACTIONPIN; else if (type == SysmlConstants.EVENT) elementType = SysmlConstants.SYSMLEVENT; } else if (type == SysmlConstants.MERGENODE) elementType = SysmlConstants.SYSMLMERGENODE; else if (type == SysmlConstants.SYNCHRONIZATION) { - if (stereotype == stereotypeConstants.join) elementType = SysmlConstants.SYSMLJOIN; - else if (stereotype == stereotypeConstants.fork) elementType = SysmlConstants.SYSMLFORK; + if (stereotype == StereotypeConstants.JOIN) elementType = SysmlConstants.SYSMLJOIN; + else if (stereotype == StereotypeConstants.FORK) elementType = SysmlConstants.SYSMLFORK; else elementType = SysmlConstants.SYSMLSYNCHRONIZATION; } else if (type == SysmlConstants.INTERRUPTIBLEACTIVITYREGION ) elementType = SysmlConstants.SYSMLINTERRUPTIBLEACTIVITYREGION; - else if (stereotype == stereotypeConstants.flowSpecification) elementType = SysmlConstants.SYSMLFLOWSPECIFICATION; - else if (stereotype == stereotypeConstants.external || stereotype == stereotypeConstants.subsystem || stereotype == stereotypeConstants.system || stereotype == stereotypeConstants.systemContext) elementType = SysmlConstants.SYSMLBLOCK; + else if (stereotype == StereotypeConstants.FLOWSPECIFICATION) elementType = SysmlConstants.SYSMLFLOWSPECIFICATION; + else if (stereotype == StereotypeConstants.EXTERNAL || stereotype == StereotypeConstants.SUBSYSTEM || stereotype == StereotypeConstants.SYSTEM || stereotype == StereotypeConstants.SYSTEMCONTEXT) elementType = SysmlConstants.SYSMLBLOCK; return elementType; } }