diff --git a/MTIP/Constants/ActivityConstants.cs b/MTIP/Constants/ActivityConstants.cs index 8095388..a9e5fcb 100644 --- a/MTIP/Constants/ActivityConstants.cs +++ b/MTIP/Constants/ActivityConstants.cs @@ -7,67 +7,34 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class ActivityConstants + public static class ActivityConstants { - public string acceptEventAction; - public string action; - public string actionPin; - public string activity; - public string activityParameter; - public string activityPartion; - public string callBehaviorAction; - public string callOperationAction; - public string centralBufferNode; - public string change; - public string conditionalNode; - public string createObjectAction; - public string decision; - public string destroyObjectAction; - public string eventType; - public string forkNode; - public string informationItem; - public string interruptibleActivityRegion; - public string mergeNode; - public string objectNode; - public string property; - public string sendSignalAction; - public string stateNode; - public string synchronization; - - - public ActivityConstants(){ - acceptEventAction = "AcceptEventAction"; - action = "Action"; - actionPin = "ActionPin"; - activity = "Activity"; - activityParameter = "ActivityParameter"; - activityPartion = "ActivityPartition"; - callBehaviorAction = "CallBehaviorAction"; - callOperationAction = "CallOperationAction"; - centralBufferNode = "CentralBufferNode"; - change = "Change"; - conditionalNode = "ConditionalNode"; - createObjectAction = "CreateObjectAction"; - decision = "Decision"; - destroyObjectAction = "DestroyObjectAction"; - eventType = "Event"; - forkNode = "ForkNode"; - informationItem = "InformationItem"; - interruptibleActivityRegion = "InterruptibleActivityRegion"; - mergeNode = "MergeNode"; - objectNode = "ObjectNode"; - property = "Property"; - sendSignalAction = "SendSignalAction"; - stateNode = "StateNode"; - synchronization = "Synchronization"; - } + public const string ACCEPTEVENTACTION = "AcceptEventAction"; + public const string ACTION = "Action"; + public const string ACTIONPIN = "ActionPin"; + public const string ACTIVITY = "Activity"; + public const string ACTIVITYPARAMETER = "ActivityParameter"; + public const string ACTIVITYPARTION = "ActivityPartition"; + public const string CALLBEHAVIORACTION = "CallBehaviorAction"; + public const string CALLOPERATIONACTION = "CallOperationAction"; + public const string CENTRALBUFFERNODE = "CentralBufferNode"; + public const string CHANGE = "Change"; + public const string CONDITIONALNODE = "ConditionalNode"; + public const string CREATEOBJECTACTION = "CreateObjectAction"; + public const string DECISION = "Decision"; + public const string DESTROYOBJECTACTION = "DestroyObjectAction"; + public const string EVENTTYPE = "Event"; + public const string FORKNODE = "ForkNode"; + public const string INFORMATIONITEM = "InformationItem"; + public const string INTERRUPTIBLEACTIVITYREGION = "InterruptibleActivityRegion"; + public const string MERGENODE = "MergeNode"; + public const string OBJECTNODE = "ObjectNode"; + public const string PROPERTY = "Property"; + public const string SENDSIGNALACTION = "SendSignalAction"; + public const string STATENODE = "StateNode"; + public const string SYNCHRONIZATION = "Synchronization"; } } + diff --git a/MTIP/Constants/BlockConstants.cs b/MTIP/Constants/BlockConstants.cs index 3b3324c..f1cc9eb 100644 --- a/MTIP/Constants/BlockConstants.cs +++ b/MTIP/Constants/BlockConstants.cs @@ -7,54 +7,28 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class BlockConstants + public static class BlockConstants { - public string association; - public string block; - public string constraintBlock; - public string dataType; - public string enumeration; - public string external; - public string flowPort; - public string fullPort; - public string interfaceBlock; - public string interfaceType; - public string operation; - public string port; - public string property; - public string proxyPort; - public string quantityKind; - public string signal; - public string unit; - public string valueType; - public BlockConstants() - { - association = "Association"; - block = "Block"; - constraintBlock = "ConstraintBlock"; - dataType = "DataType"; - enumeration = "Enumeration"; - external = "External"; - flowPort = "FlowPort"; - fullPort = "FullPort"; - interfaceBlock = "InterfaceBlock"; - interfaceType = "Interface"; - operation = "Operation"; - port = "Port"; - property = "Property"; - proxyPort = "ProxyPort"; - quantityKind = "QuantityKind"; - signal = "Signal"; - unit = "Unit"; - valueType = "ValueType"; - } + public const string ASSOCIATION = "Association"; + public const string BLOCK = "Block"; + public const string CONSTRAINTBLOCK = "ConstraintBlock"; + public const string DATATYPE = "DataType"; + public const string ENUMERATION = "Enumeration"; + public const string EXTERNAL = "External"; + public const string FLOWPORT = "FlowPort"; + public const string FULLPORT = "FullPort"; + public const string INTERFACEBLOCK = "InterfaceBlock"; + public const string INTERFACETYPE = "Interface"; + public const string OPERATION = "Operation"; + public const string PORT = "Port"; + public const string PROPERTY = "Property"; + public const string PROXYPORT = "ProxyPort"; + public const string QUANTITYKIND = "QuantityKind"; + public const string SIGNAL = "Signal"; + public const string UNIT = "Unit"; + public const string VALUETYPE = "ValueType"; } } + diff --git a/MTIP/Constants/DiagramConstants.cs b/MTIP/Constants/DiagramConstants.cs index 9680588..c5ffa76 100644 --- a/MTIP/Constants/DiagramConstants.cs +++ b/MTIP/Constants/DiagramConstants.cs @@ -15,30 +15,18 @@ namespace MTIP.Constants { - public class DiagramConstants + public static class DiagramConstants { - public string activity; - public string classType; - public string component; - public string compositeStructure; - public string custom; - public string logical; - public string package; - public string sequence; - public string statechart; - public string useCase; - public DiagramConstants() - { - activity = "Activity"; - classType = "Class"; - component = "Component"; - compositeStructure = "CompositeStructure"; - custom = "Custom"; - logical = "Logical"; - package = "Package"; - sequence = "Sequence"; - statechart = "Statechart"; - useCase = "Use Case"; - } + public const string activity = "Activity"; + public const string classType = "Class"; + public const string component = "Component"; + public const string compositeStructure = "CompositeStructure"; + public const string custom = "Custom"; + public const string logical = "Logical"; + public const string package = "Package"; + public const string sequence = "Sequence"; + public const string statechart = "Statechart"; + public const string useCase = "Use Case"; } + } diff --git a/MTIP/Constants/HUDSConstants.cs b/MTIP/Constants/HUDSConstants.cs index 06c937d..a364b43 100644 --- a/MTIP/Constants/HUDSConstants.cs +++ b/MTIP/Constants/HUDSConstants.cs @@ -7,58 +7,30 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class HUDSConstants + public static class HUDSConstants { - public string attributes; - public string data; - public string dict; - public string dtype; - public string ea; - public string unified; - public string element; - public string id; - public string intType; - public string isComposite; - public string key; - public string list; - public string name; - public string relationshipMetadata; - public string relationships; - public string status; - public string str; - public string type; - public string typedBy; - public string value; - public HUDSConstants() - { - attributes = "attributes"; - data = "data"; - dict = "dict"; - dtype = "_dtype"; - ea = "ea"; - unified = "unified"; - element = "element"; - id = "id"; - intType = "int"; - isComposite = "isComposite"; - key = "key"; - list = "list"; - name = "name"; - relationshipMetadata = "relationship_metadata"; - relationships = "relationships"; - status = "status"; - str = "str"; - type = "type"; - typedBy = "typedBy"; - value = "value"; - } + public const string ATTRIBUTES = "attributes"; + public const string DATA = "data"; + public const string DICT = "dict"; + public const string DTYPE = "_dtype"; + public const string EA = "ea"; + public const string UNIFIED = "unified"; + public const string ELEMENT = "element"; + public const string ID = "id"; + public const string INTTYPE = "int"; + public const string ISCOMPOSITE = "isComposite"; + public const string KEY = "key"; + public const string LIST = "list"; + public const string NAME = "name"; + public const string RELATIONSHIPMETADATA = "relationship_metadata"; + public const string RELATIONSHIPS = "relationships"; + public const string STATUS = "status"; + public const string STR = "str"; + public const string TYPE = "type"; + public const string TYPEDBY = "typedBy"; + public const string VALUE = "value"; } } + diff --git a/MTIP/Constants/InternalBlockConstants.cs b/MTIP/Constants/InternalBlockConstants.cs index 35bf419..ef3b8a5 100644 --- a/MTIP/Constants/InternalBlockConstants.cs +++ b/MTIP/Constants/InternalBlockConstants.cs @@ -7,33 +7,17 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class InternalBlockConstants + public static class InternalBlockConstants { - public string boundary; - public string boundReference; - public string constraintProperty; - public string flowProperty; - public string participantProperty; - public string property; - public string referenceProperty; - - public InternalBlockConstants() - { - boundary = "Boundary"; - boundReference = "BoundReference"; - constraintProperty = "ConstraintProperty"; - flowProperty = "FlowProperty"; - participantProperty = "ParticipantProperty"; - property = "Property"; - referenceProperty = "ReferenceProperty"; - } + public const string BOUNDARY = "Boundary"; + public const string BOUNDREFERENCE = "BoundReference"; + public const string CONSTRAINTPROPERTY = "ConstraintProperty"; + public const string FLOWPROPERTY = "FlowProperty"; + public const string PARTICIPANTPROPERTY = "ParticipantProperty"; + public const string PROPERTY = "Property"; + public const string REFERENCEPROPERTY = "ReferenceProperty"; } } + diff --git a/MTIP/Constants/MetatypeConstants.cs b/MTIP/Constants/MetatypeConstants.cs index aee351e..5a62aff 100644 --- a/MTIP/Constants/MetatypeConstants.cs +++ b/MTIP/Constants/MetatypeConstants.cs @@ -9,38 +9,23 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; + namespace MTIP.Constants { - public class MetatypeConstants + + public static class MetatypeConstants { - public string acceptEventAction; - public string callBehaviorAction; - public string callOperationAction; - public string createObjectAction; - public string destroyObjectAction; - public string inputPin; - public string opaqueAction; - public string outputPin; - public string pseudostate; - public string sendSignalAction; - public MetatypeConstants() - { - acceptEventAction = "AcceptEventAction"; - callBehaviorAction = "CallBehaviorAction"; - callOperationAction = "CallOperationAction"; - createObjectAction = "CreateObjectAction"; - destroyObjectAction = "DestroyObjectAction"; - inputPin = "InputPin"; - opaqueAction = "OpaqueAction"; - outputPin = "OutputPin"; - pseudostate = "Pseudostate"; - sendSignalAction = "SendSignalAction"; - } + public const string acceptEventAction = "AcceptEventAction"; + public const string callBehaviorAction = "CallBehaviorAction"; + public const string callOperationAction = "CallOperationAction"; + public const string createObjectAction = "CreateObjectAction"; + public const string destroyObjectAction = "DestroyObjectAction"; + public const string inputPin = "InputPin"; + public const string opaqueAction = "OpaqueAction"; + public const string outputPin = "OutputPin"; + public const string pseudostate = "Pseudostate"; + public const string sendSignalAction = "SendSignalAction"; } + } diff --git a/MTIP/Constants/ModelConstants.cs b/MTIP/Constants/ModelConstants.cs index 5ae61de..76c6788 100644 --- a/MTIP/Constants/ModelConstants.cs +++ b/MTIP/Constants/ModelConstants.cs @@ -6,29 +6,15 @@ * Description: Constants for types used to assign Model element types * */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class ModelConstants + public static class ModelConstants { - public string documentation; - public string model; - public string profile; - public string stereotype; - public string text; - public ModelConstants() - { - this.documentation = "documentation"; - this.model = "Model"; - this.profile = "profile"; - this.stereotype = "stereotype"; - this.text = "text"; - } + public const string DOCUMENTATION = "documentation"; + public const string MODEL = "Model"; + public const string PROFILE = "profile"; + public const string STEREOTYPE = "stereotype"; + public const string TEXT = "text"; } } + diff --git a/MTIP/Constants/ProfileConstants.cs b/MTIP/Constants/ProfileConstants.cs index fe37781..1fb8915 100644 --- a/MTIP/Constants/ProfileConstants.cs +++ b/MTIP/Constants/ProfileConstants.cs @@ -7,37 +7,20 @@ * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace MTIP.Constants { - public class ProfileConstants + public static class ProfileConstants { - public string classType; - public string constraint; - public string exceptionHandler; - public string note; - public string objectiveFunction; - public string objectType; - public string package; - public string part; - public string text; - - public ProfileConstants(){ - classType = "Class"; - constraint = "Constraint"; - exceptionHandler = "ExceptionHandler"; - note = "Note"; - objectiveFunction = "ObjectiveFunction"; - objectType = "Object"; - package = "Package"; - part = "Part"; - text = "Text"; + public const string CLASSTYPE = "Class"; + public const string CONSTRAINT = "Constraint"; + public const string EXCEPTIONHANDLER = "ExceptionHandler"; + public const string NOTE = "Note"; + public const string OBJECTIVEFUNCTION = "ObjectiveFunction"; + public const string OBJECTTYPE = "Object"; + public const string PACKAGE = "Package"; + public const string PART = "Part"; + public const string TEXT = "Text"; } } -} + diff --git a/MTIP/Translations/MTIPCommon.cs b/MTIP/Translations/MTIPCommon.cs index 2cc2390..eff65dc 100644 --- a/MTIP/Translations/MTIPCommon.cs +++ b/MTIP/Translations/MTIPCommon.cs @@ -5,27 +5,26 @@ namespace MTIP.Translations { internal static class MTIPCommon { - //DS: Not the way I would do this. + public static RelationshipConstants relationshipConstants = new RelationshipConstants(); - public static HUDSConstants hudsConstants =new HUDSConstants(); - + internal static XmlElement CreateIdElement(XmlDocument xmlDocument, string eaElementGuid) { XmlElement idElement = xmlDocument.CreateElement(AttributeConstants.ID); - idElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + idElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); //unified ID shall be the new Vendor independed ID field for cross tool roundtrips. - XmlElement unifiedIdElement = xmlDocument.CreateElement(hudsConstants.unified); - unifiedIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement unifiedIdElement = xmlDocument.CreateElement(HUDSConstants.UNIFIED); + unifiedIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); unifiedIdElement.InnerText = eaElementGuid.ToString(); idElement.AppendChild(unifiedIdElement); //unified ID shall be the new Vendor specific ID field for cross tool roundtrips, best case this is not required going forward - XmlElement eaIdElement = xmlDocument.CreateElement(hudsConstants.ea); - eaIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement eaIdElement = xmlDocument.CreateElement(HUDSConstants.EA); + eaIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); eaIdElement.InnerText = eaElementGuid.ToString(); idElement.AppendChild(eaIdElement); diff --git a/MTIP/Translations/MTIPExportFunctions.cs b/MTIP/Translations/MTIPExportFunctions.cs index dd8cb5b..aad3009 100644 --- a/MTIP/Translations/MTIPExportFunctions.cs +++ b/MTIP/Translations/MTIPExportFunctions.cs @@ -30,12 +30,11 @@ public class MTIPExportFunctions public List exportLog; public RelationshipConstants relationshipConstants; - public HUDSConstants hudsConstants; - public DiagramConstants diagramConstants; - public ActivityConstants activityConstants; - public BlockConstants blockConstants; + + + public StereotypeConstants stereotypeConstants; - public ModelConstants modelConstants; + public Dictionary customProfiles; public MTIPExportFunctions(MTIP plugin) @@ -45,12 +44,10 @@ public MTIPExportFunctions(MTIP plugin) exportLog = new List(); relationshipConstants = new RelationshipConstants(); - hudsConstants = new HUDSConstants(); - diagramConstants = new DiagramConstants(); - activityConstants = new ActivityConstants(); - blockConstants = new BlockConstants(); + + stereotypeConstants = new StereotypeConstants(); - modelConstants = new ModelConstants(); + customProfiles = new Dictionary(); } public void ExportToMTIPXML() @@ -128,8 +125,8 @@ private void selectOutputDir() public void UnpackagePackage(EA.Package package, XmlDocument xmlDocument, string parentGuid, string parentType, bool isRootNode) { // Get package SysML type - XmlElement typeElement = xmlDocument.CreateElement(hudsConstants.type); - typeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement typeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + typeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); string packageType = ""; if (package.IsModel) packageType = SysmlConstants.SYSMLMODEL; else packageType = GetPackageType(package); @@ -143,20 +140,20 @@ public void UnpackagePackage(EA.Package package, XmlDocument xmlDocument, string // Create attributes element to add to data node XmlElement attributesElement = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTES); - attributesElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); - CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, hudsConstants.str, package.Name, attributesElement); + attributesElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); + CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, HUDSConstants.STR, package.Name, attributesElement); if (package.IsModel != true) { if (package.Element.Stereotype != "") { XmlElement stereotypeAttribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - stereotypeAttribute.SetAttribute(hudsConstants.dtype, hudsConstants.dict); - stereotypeAttribute.SetAttribute(hudsConstants.key, AttributeConstants.STEREOTYPE); + stereotypeAttribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); + stereotypeAttribute.SetAttribute(HUDSConstants.KEY, AttributeConstants.STEREOTYPE); XmlElement stereotypeNameAttribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - stereotypeNameAttribute.SetAttribute(hudsConstants.dtype, hudsConstants.str); - stereotypeNameAttribute.SetAttribute(hudsConstants.key, AttributeConstants.STEREOTYPENAME); + stereotypeNameAttribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); + stereotypeNameAttribute.SetAttribute(HUDSConstants.KEY, AttributeConstants.STEREOTYPENAME); stereotypeNameAttribute.InnerText = package.Element.Stereotype; @@ -168,13 +165,13 @@ public void UnpackagePackage(EA.Package package, XmlDocument xmlDocument, string string note = Regex.Replace(package.Notes, "<[^>]+>", string.Empty); note = Regex.Replace(note, ">", "greater than"); note = Regex.Replace(note, "<", "less than"); - CreateHUDSAttribute(xmlDocument, AttributeConstants.DOCUMENTATION, hudsConstants.str, note, attributesElement); + CreateHUDSAttribute(xmlDocument, AttributeConstants.DOCUMENTATION, HUDSConstants.STR, note, attributesElement); } - if (package.Element.Alias != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.ALIAS, hudsConstants.str, package.Element.Alias, attributesElement); + if (package.Element.Alias != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.ALIAS, HUDSConstants.STR, package.Element.Alias, attributesElement); } // Add type, id, and attributes node to data node - XmlElement dataElement = xmlDocument.CreateElement(hudsConstants.data); + XmlElement dataElement = xmlDocument.CreateElement(HUDSConstants.DATA); dataElement.AppendChild(typeElement); dataElement.AppendChild(idElement); dataElement.AppendChild(attributesElement); @@ -183,20 +180,20 @@ public void UnpackagePackage(EA.Package package, XmlDocument xmlDocument, string if (parentGuid != null || isRootNode == false) { XmlElement relationshipsElement = xmlDocument.CreateElement(relationshipConstants.relationships); - relationshipsElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + relationshipsElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement hasParentElement = xmlDocument.CreateElement(relationshipConstants.hasParent); - hasParentElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + hasParentElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement hasParentTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - hasParentTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hasParentTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentTypeElement.InnerText = parentType; XmlElement hasParentIdElement = xmlDocument.CreateElement(relationshipConstants.id); - hasParentIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hasParentIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentIdElement.InnerText = parentGuid; - XmlElement relMetadataElement = xmlDocument.CreateElement(hudsConstants.relationshipMetadata); + XmlElement relMetadataElement = xmlDocument.CreateElement(HUDSConstants.RELATIONSHIPMETADATA); hasParentElement.AppendChild(hasParentTypeElement); hasParentElement.AppendChild(hasParentIdElement); @@ -235,13 +232,13 @@ public void UnpackagePackage(EA.Package package, XmlDocument xmlDocument, string private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, string parentGuid, string parentType) { string profile = ""; - XmlElement dataElement = xmlDocument.CreateElement(hudsConstants.data); - XmlElement attributesElement = xmlDocument.CreateElement(hudsConstants.attributes); - attributesElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); - XmlElement typeElement = xmlDocument.CreateElement(hudsConstants.type); - typeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); - XmlElement relationshipsElement = xmlDocument.CreateElement(hudsConstants.relationships); - relationshipsElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + XmlElement dataElement = xmlDocument.CreateElement(HUDSConstants.DATA); + XmlElement attributesElement = xmlDocument.CreateElement(HUDSConstants.ATTRIBUTES); + attributesElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); + XmlElement typeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + typeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); + XmlElement relationshipsElement = xmlDocument.CreateElement(HUDSConstants.RELATIONSHIPS); + relationshipsElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); string elementType = GetSysMLType(element.Type, element.Stereotype, element.Subtype, element.MetaType); @@ -257,18 +254,18 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin // Get element profiles and attributes if (element.PropertyType != 0) { - XmlElement typedByRelationship = xmlDocument.CreateElement(hudsConstants.typedBy); - typedByRelationship.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + XmlElement typedByRelationship = xmlDocument.CreateElement(HUDSConstants.TYPEDBY); + typedByRelationship.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); EA.Element typedByElement = repository.GetElementByID(element.PropertyType); string typedByType = GetSysMLType(typedByElement.Type, typedByElement.Stereotype, typedByElement.Subtype, typedByElement.MetaType); - XmlElement typedbByTypeElement = xmlDocument.CreateElement(hudsConstants.type); - typedbByTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement typedbByTypeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + typedbByTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); typedbByTypeElement.InnerText = typedByType; typedByRelationship.AppendChild(typedbByTypeElement); - XmlElement typedByIdElement = xmlDocument.CreateElement(hudsConstants.id); - typedByIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement typedByIdElement = xmlDocument.CreateElement(HUDSConstants.ID); + typedByIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); typedByIdElement.InnerText = typedByElement.ElementGUID.Substring(1, element.ElementGUID.Length - 2); typedByRelationship.AppendChild(typedByIdElement); @@ -284,13 +281,13 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin else if (elementType == SysmlConstants.SYSMLFLOWPORT || elementType == SysmlConstants.SYSMLFULLPORT || elementType == SysmlConstants.SYSMLPROXYPORT || elementType == SysmlConstants.SYSMLPORT || elementType == SysmlConstants.SYSMLCONSTRAINTBLOCK || elementType == SysmlConstants.CONSTRAINTPROPERTY || elementType == SysmlConstants.SYSMLPARTPROPERTY) { - if (elementType != SysmlConstants.SYSMLPARTPROPERTY) CreateHUDSAttribute(xmlDocument, AttributeConstants.ISCOMPOSITE, hudsConstants.str, element.IsComposite.ToString(), attributesElement); + if (elementType != SysmlConstants.SYSMLPARTPROPERTY) CreateHUDSAttribute(xmlDocument, AttributeConstants.ISCOMPOSITE, HUDSConstants.STR, element.IsComposite.ToString(), attributesElement); if (elementType != SysmlConstants.SYSMLPORT && elementType != SysmlConstants.SYSMLPARTPROPERTY) { profile = "SysML"; } } else if (elementType == SysmlConstants.SYSMLSTATE && element.ClassfierID != 0) { EA.Element classifierElement = repository.GetElementByID(element.ClassifierID); - CreateHUDSAttribute(xmlDocument, AttributeConstants.SUBMACHINE, hudsConstants.str, classifierElement.ElementGUID.Substring(1, element.ElementGUID.Length - 2), attributesElement); + CreateHUDSAttribute(xmlDocument, AttributeConstants.SUBMACHINE, HUDSConstants.STR, classifierElement.ElementGUID.Substring(1, element.ElementGUID.Length - 2), attributesElement); } else if (elementType == SysmlConstants.SYSMLTEXT && element.Name.Contains("://{")) @@ -301,15 +298,15 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin string[] hyperlinkPointType = element.Name.Remove(0, 1).Split(':'); XmlElement hyperlinkRelationship = xmlDocument.CreateElement(relationshipConstants.hyperlink); - hyperlinkRelationship.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + hyperlinkRelationship.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement hyperlinkTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - hyperlinkTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hyperlinkTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hyperlinkTypeElement.InnerText = hyperlinkPointType[0]; hyperlinkRelationship.AppendChild(hyperlinkTypeElement); - XmlElement hyperlinkIdIdElement = xmlDocument.CreateElement(hudsConstants.id); - hyperlinkIdIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement hyperlinkIdIdElement = xmlDocument.CreateElement(HUDSConstants.ID); + hyperlinkIdIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hyperlinkIdIdElement.InnerText = hyperlinkId[0]; hyperlinkRelationship.AppendChild(hyperlinkIdIdElement); @@ -331,15 +328,15 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin XmlElement classifiedByRelationship; if (elementType == SysmlConstants.SYSMLACCEPTEVENTACTION || classifierType == SysmlConstants.SYSMLSENDSIGNALACTION) classifiedByRelationship = xmlDocument.CreateElement(relationshipConstants.trigger); else classifiedByRelationship = xmlDocument.CreateElement(relationshipConstants.classifiedBy); - classifiedByRelationship.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + classifiedByRelationship.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); - XmlElement hyperlinkTypeElement = xmlDocument.CreateElement(hudsConstants.type); - hyperlinkTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement hyperlinkTypeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + hyperlinkTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hyperlinkTypeElement.InnerText = classifierType; classifiedByRelationship.AppendChild(hyperlinkTypeElement); - XmlElement hyperlinkIdIdElement = xmlDocument.CreateElement(hudsConstants.id); - hyperlinkIdIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement hyperlinkIdIdElement = xmlDocument.CreateElement(HUDSConstants.ID); + hyperlinkIdIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hyperlinkIdIdElement.InnerText = classifierElement.ElementGUID.Substring(1, element.ElementGUID.Length - 2); classifiedByRelationship.AppendChild(hyperlinkIdIdElement); @@ -350,16 +347,16 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin exportLog.Add("Unable to add classifier to xml: Name=" + element.Name + " - GUID=" + element.ElementGUID + " - Type=" + element.Type + " - Stereotype=" + element.Stereotype); } } - if (element.Name != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, hudsConstants.str, element.Name, attributesElement); + if (element.Name != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, HUDSConstants.STR, element.Name, attributesElement); if (element.Notes != "") { string note = Regex.Replace(element.Notes, "<[^>]+>", string.Empty); note = Regex.Replace(note, ">", "greater than"); note = Regex.Replace(note, "<", "less than"); - CreateHUDSAttribute(xmlDocument, AttributeConstants.DOCUMENTATION, hudsConstants.str, note, attributesElement); + CreateHUDSAttribute(xmlDocument, AttributeConstants.DOCUMENTATION, HUDSConstants.STR, note, attributesElement); } - if (element.Alias != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.ALIAS, hudsConstants.str, element.Alias, attributesElement); - if (element.Multiplicity != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.MULTIPLICITY, hudsConstants.str, element.Multiplicity, attributesElement); + if (element.Alias != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.ALIAS, HUDSConstants.STR, element.Alias, attributesElement); + if (element.Multiplicity != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.MULTIPLICITY, HUDSConstants.STR, element.Multiplicity, attributesElement); if (element.IsComposite && element.CompositeDiagram != null) { try @@ -367,15 +364,15 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin EA.Diagram diagramElement = repository.GetDiagramByGuid(element.CompositeDiagram.DiagramGUID); string diagramType = GetDiagramSysMLType(diagramElement); XmlElement compositeDiagramRelationship = xmlDocument.CreateElement(relationshipConstants.compositeDiagram); - compositeDiagramRelationship.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + compositeDiagramRelationship.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); - XmlElement diagramTypeElement = xmlDocument.CreateElement(hudsConstants.type); - diagramTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement diagramTypeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + diagramTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); diagramTypeElement.InnerText = diagramType; compositeDiagramRelationship.AppendChild(diagramTypeElement); - XmlElement diagramIdElement = xmlDocument.CreateElement(hudsConstants.id); - diagramIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement diagramIdElement = xmlDocument.CreateElement(HUDSConstants.ID); + diagramIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); diagramIdElement.InnerText = element.CompositeDiagram.DiagramGUID.Substring(1, element.CompositeDiagram.DiagramGUID.Length - 2); compositeDiagramRelationship.AppendChild(diagramIdElement); @@ -391,20 +388,20 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin if (element.Stereotype != "") { XmlElement stereotypeAttribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - stereotypeAttribute.SetAttribute(hudsConstants.dtype, hudsConstants.dict); - stereotypeAttribute.SetAttribute(hudsConstants.key, AttributeConstants.STEREOTYPE); + stereotypeAttribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); + stereotypeAttribute.SetAttribute(HUDSConstants.KEY, AttributeConstants.STEREOTYPE); XmlElement stereotypeNameAttribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - stereotypeNameAttribute.SetAttribute(hudsConstants.dtype, hudsConstants.str); - stereotypeNameAttribute.SetAttribute(hudsConstants.key, AttributeConstants.STEREOTYPENAME); + stereotypeNameAttribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); + stereotypeNameAttribute.SetAttribute(HUDSConstants.KEY, AttributeConstants.STEREOTYPENAME); stereotypeNameAttribute.InnerText = element.StereotypeEx; stereotypeAttribute.AppendChild(stereotypeNameAttribute); if (profile != "") { XmlElement stereotypeProfileAttribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - stereotypeProfileAttribute.SetAttribute(hudsConstants.dtype, hudsConstants.str); - stereotypeProfileAttribute.SetAttribute(hudsConstants.key, AttributeConstants.PROFILENAME); + stereotypeProfileAttribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); + stereotypeProfileAttribute.SetAttribute(HUDSConstants.KEY, AttributeConstants.PROFILENAME); stereotypeProfileAttribute.InnerText = profile; stereotypeAttribute.AppendChild(stereotypeProfileAttribute); } @@ -417,22 +414,22 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin { int key = 0; XmlElement attributesbehaviorElement = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attributesbehaviorElement.SetAttribute(hudsConstants.key, AttributeConstants.BEHAVIOR); - attributesbehaviorElement.SetAttribute(hudsConstants.dtype, hudsConstants.list); + attributesbehaviorElement.SetAttribute(HUDSConstants.KEY, AttributeConstants.BEHAVIOR); + attributesbehaviorElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.LIST); foreach (EA.Method method in element.Methods) { bool hasBehavior = false; if (method.Behavior != "") { XmlElement attribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attribute.SetAttribute(hudsConstants.key, key.ToString()); - attribute.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + attribute.SetAttribute(HUDSConstants.KEY, key.ToString()); + attribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); if (method.Name != "") { XmlElement attributeName = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attributeName.SetAttribute(hudsConstants.key, AttributeConstants.NAME); - attributeName.SetAttribute(hudsConstants.dtype, hudsConstants.str); + attributeName.SetAttribute(HUDSConstants.KEY, AttributeConstants.NAME); + attributeName.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); attributeName.InnerText = method.Name; attribute.AppendChild(attributeName); hasBehavior = true; @@ -440,8 +437,8 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin if (method.Behavior != "") { XmlElement attributeBehavior = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attributeBehavior.SetAttribute(hudsConstants.key, AttributeConstants.VALUE); - attributeBehavior.SetAttribute(hudsConstants.dtype, hudsConstants.str); + attributeBehavior.SetAttribute(HUDSConstants.KEY, AttributeConstants.VALUE); + attributeBehavior.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); attributeBehavior.InnerText = method.Behavior; attribute.AppendChild(attributeBehavior); hasBehavior = true; @@ -449,8 +446,8 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin if (method.ReturnType != "") { XmlElement attributeReturnType = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attributeReturnType.SetAttribute(hudsConstants.key, AttributeConstants.TYPE); - attributeReturnType.SetAttribute(hudsConstants.dtype, hudsConstants.str); + attributeReturnType.SetAttribute(HUDSConstants.KEY, AttributeConstants.TYPE); + attributeReturnType.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); attributeReturnType.InnerText = method.ReturnType; attribute.AppendChild(attributeReturnType); hasBehavior = true; @@ -482,19 +479,19 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin { int key = 0; XmlElement attributesAttributeElement = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attributesAttributeElement.SetAttribute(hudsConstants.key, AttributeConstants.ATTRIBUTE); - attributesAttributeElement.SetAttribute(hudsConstants.dtype, hudsConstants.list); + attributesAttributeElement.SetAttribute(HUDSConstants.KEY, AttributeConstants.ATTRIBUTE); + attributesAttributeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.LIST); foreach (EA.Attribute attribute in element.Attributes) { XmlElement attElement = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attElement.SetAttribute(hudsConstants.key, key.ToString()); + attElement.SetAttribute(HUDSConstants.KEY, key.ToString()); - CreateHUDSAttribute(xmlDocument, AttributeConstants.TYPE, hudsConstants.str, attribute.Type, attElement); - CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, hudsConstants.str, attribute.Name, attElement); - if (attribute.Default != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.INITIALVALUE, hudsConstants.str, attribute.Default, attElement); - if (attribute.Visibility != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.VISIBILITY, hudsConstants.str, attribute.Visibility, attElement); - if (attribute.Stereotype != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.STEREOTYPE, hudsConstants.str, attribute.Stereotype, attElement); - if (attribute.Alias != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.ALIAS, hudsConstants.str, attribute.Alias, attElement); + CreateHUDSAttribute(xmlDocument, AttributeConstants.TYPE, HUDSConstants.STR, attribute.Type, attElement); + CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, HUDSConstants.STR, attribute.Name, attElement); + if (attribute.Default != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.INITIALVALUE, HUDSConstants.STR, attribute.Default, attElement); + if (attribute.Visibility != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.VISIBILITY, HUDSConstants.STR, attribute.Visibility, attElement); + if (attribute.Stereotype != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.STEREOTYPE, HUDSConstants.STR, attribute.Stereotype, attElement); + if (attribute.Alias != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.ALIAS, HUDSConstants.STR, attribute.Alias, attElement); attributesAttributeElement.AppendChild(attElement); @@ -503,7 +500,7 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin attributesElement.AppendChild(attributesAttributeElement); } - if (element.ExtensionPoints != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.EXTENSIONPOINT, hudsConstants.str, element.ExtensionPoints, attributesElement); + if (element.ExtensionPoints != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.EXTENSIONPOINT, HUDSConstants.STR, element.ExtensionPoints, attributesElement); Dictionary taggedValues = new Dictionary(); // Get element tagged values @@ -528,26 +525,26 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin if (taggedValues.Count > 0) { XmlElement attributesTagsElement = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attributesTagsElement.SetAttribute(hudsConstants.key, AttributeConstants.TAGGEDVALUE); + attributesTagsElement.SetAttribute(HUDSConstants.KEY, AttributeConstants.TAGGEDVALUE); - attributesTagsElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + attributesTagsElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); foreach (KeyValuePair taggedValue in taggedValues) { - CreateHUDSAttribute(xmlDocument, taggedValue.Key, hudsConstants.str, taggedValue.Value, attributesTagsElement); + CreateHUDSAttribute(xmlDocument, taggedValue.Key, HUDSConstants.STR, taggedValue.Value, attributesTagsElement); } attributesElement.AppendChild(attributesTagsElement); } // Add relationships to the data element XmlElement hasParentElement = xmlDocument.CreateElement(relationshipConstants.hasParent); - hasParentElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + hasParentElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); - XmlElement hasParentTypeElement = xmlDocument.CreateElement(hudsConstants.type); - hasParentTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement hasParentTypeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + hasParentTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentTypeElement.InnerText = parentType; - XmlElement hasParentIdElement = xmlDocument.CreateElement(hudsConstants.id); - hasParentIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement hasParentIdElement = xmlDocument.CreateElement(HUDSConstants.ID); + hasParentIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentIdElement.InnerText = parentGuid; hasParentElement.AppendChild(hasParentTypeElement); @@ -625,17 +622,17 @@ private void UnpackageElement(EA.Element element, XmlDocument xmlDocument, strin } public void UnpackageDiagram(EA.Diagram diagram, XmlDocument xmlDocument, string parentGuid, string parentType) { - XmlElement dataElement = xmlDocument.CreateElement(hudsConstants.data); + XmlElement dataElement = xmlDocument.CreateElement(HUDSConstants.DATA); XmlElement attributesElement = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTES); - attributesElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); - XmlElement typeElement = xmlDocument.CreateElement(hudsConstants.type); - typeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); - XmlElement relationshipsElement = xmlDocument.CreateElement(hudsConstants.relationships); - relationshipsElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + attributesElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); + XmlElement typeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + typeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); + XmlElement relationshipsElement = xmlDocument.CreateElement(HUDSConstants.RELATIONSHIPS); + relationshipsElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); string diagramGuid = diagram.DiagramGUID.Substring(1, diagram.DiagramGUID.Length - 2); string diagramType = GetDiagramSysMLType(diagram); - if (diagramType == SysmlConstants.SYSMLPACKAGE) CreateHUDSAttribute(xmlDocument, AttributeConstants.DISPLAYAS, hudsConstants.str, "Diagram", attributesElement); + if (diagramType == SysmlConstants.SYSMLPACKAGE) CreateHUDSAttribute(xmlDocument, AttributeConstants.DISPLAYAS, HUDSConstants.STR, "Diagram", attributesElement); typeElement.InnerText = diagramType; @@ -645,15 +642,15 @@ public void UnpackageDiagram(EA.Diagram diagram, XmlDocument xmlDocument, string // Create id element to be added to data element XmlElement idElement = MTIPCommon.CreateIdElement(xmlDocument, diagramGuid); - CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, hudsConstants.str, diagram.Name, attributesElement); + CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, HUDSConstants.STR, diagram.Name, attributesElement); - if (diagramType == SysmlConstants.SYSMLCLASS) CreateHUDSAttribute(xmlDocument, AttributeConstants.DISPLAYAS, hudsConstants.str, "Diagram", attributesElement); + if (diagramType == SysmlConstants.SYSMLCLASS) CreateHUDSAttribute(xmlDocument, AttributeConstants.DISPLAYAS, HUDSConstants.STR, "Diagram", attributesElement); if (diagram.DiagramObjects.Count > 0) { int key = 0; - XmlElement elementRelElement = xmlDocument.CreateElement(hudsConstants.element); - elementRelElement.SetAttribute(hudsConstants.dtype, hudsConstants.list); + XmlElement elementRelElement = xmlDocument.CreateElement(HUDSConstants.ELEMENT); + elementRelElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.LIST); foreach (EA.DiagramObject diagramObject in diagram.DiagramObjects) { @@ -665,46 +662,46 @@ public void UnpackageDiagram(EA.Diagram diagram, XmlDocument xmlDocument, string { string elementGuid = element.ElementGUID.Substring(1, element.ElementGUID.Length - 2); // Add relationships to the data element - XmlElement diagramObjectElement = xmlDocument.CreateElement(hudsConstants.element); - diagramObjectElement.SetAttribute(hudsConstants.key, key.ToString()); - diagramObjectElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + XmlElement diagramObjectElement = xmlDocument.CreateElement(HUDSConstants.ELEMENT); + diagramObjectElement.SetAttribute(HUDSConstants.KEY, key.ToString()); + diagramObjectElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement objectTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - objectTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + objectTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); objectTypeElement.InnerText = elementType; diagramObjectElement.AppendChild(objectTypeElement); - XmlElement objectIdElement = xmlDocument.CreateElement(hudsConstants.id); - objectIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement objectIdElement = xmlDocument.CreateElement(HUDSConstants.ID); + objectIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); objectIdElement.InnerText = elementGuid; diagramObjectElement.AppendChild(objectIdElement); - XmlElement relMetadataElement = xmlDocument.CreateElement(hudsConstants.relationshipMetadata); - relMetadataElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + XmlElement relMetadataElement = xmlDocument.CreateElement(HUDSConstants.RELATIONSHIPMETADATA); + relMetadataElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement objectTopElement = xmlDocument.CreateElement(relationshipConstants.relMetadataTop); - objectTopElement.SetAttribute(hudsConstants.dtype, hudsConstants.intType); + objectTopElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.INTTYPE); objectTopElement.InnerText = diagramObject.top.ToString(); relMetadataElement.AppendChild(objectTopElement); XmlElement objectLeftElement = xmlDocument.CreateElement(relationshipConstants.relMetadataLeft); - objectLeftElement.SetAttribute(hudsConstants.dtype, hudsConstants.intType); + objectLeftElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.INTTYPE); objectLeftElement.InnerText = diagramObject.left.ToString(); relMetadataElement.AppendChild(objectLeftElement); XmlElement objectBottomElement = xmlDocument.CreateElement(relationshipConstants.relMetadataBottom); - objectBottomElement.SetAttribute(hudsConstants.dtype, hudsConstants.intType); + objectBottomElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.INTTYPE); objectBottomElement.InnerText = diagramObject.bottom.ToString(); relMetadataElement.AppendChild(objectBottomElement); XmlElement objectRightElement = xmlDocument.CreateElement(relationshipConstants.relMetadataRight); - objectRightElement.SetAttribute(hudsConstants.dtype, hudsConstants.intType); + objectRightElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.INTTYPE); objectRightElement.InnerText = diagramObject.right.ToString(); relMetadataElement.AppendChild(objectRightElement); XmlElement objectSeqElement = xmlDocument.CreateElement(relationshipConstants.relMetadataSeq); - objectSeqElement.SetAttribute(hudsConstants.dtype, hudsConstants.intType); + objectSeqElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.INTTYPE); objectSeqElement.InnerText = diagramObject.Sequence.ToString(); relMetadataElement.AppendChild(objectSeqElement); @@ -727,7 +724,7 @@ public void UnpackageDiagram(EA.Diagram diagram, XmlDocument xmlDocument, string { int key = 0; XmlElement diagramLinkRelElement = xmlDocument.CreateElement(relationshipConstants.diagramConnector); - diagramLinkRelElement.SetAttribute(hudsConstants.dtype, hudsConstants.list); + diagramLinkRelElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.LIST); try { @@ -740,25 +737,25 @@ public void UnpackageDiagram(EA.Diagram diagram, XmlDocument xmlDocument, string string diagramLinkType = GetConnectorSysMLType(connectorElement); XmlElement diagramLinkElement = xmlDocument.CreateElement(relationshipConstants.diagramConnector); - diagramLinkElement.SetAttribute(hudsConstants.key, key.ToString()); - diagramLinkElement.SetAttribute(hudsConstants.dtype, hudsConstants.list); + diagramLinkElement.SetAttribute(HUDSConstants.KEY, key.ToString()); + diagramLinkElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.LIST); // Create diagram connector relationship - XmlElement diagramLinkTypeElement = xmlDocument.CreateElement(hudsConstants.type); - diagramLinkTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement diagramLinkTypeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + diagramLinkTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); diagramLinkTypeElement.InnerText = diagramLinkType; - XmlElement diagramLinkIdElement = xmlDocument.CreateElement(hudsConstants.id); - diagramLinkIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement diagramLinkIdElement = xmlDocument.CreateElement(HUDSConstants.ID); + diagramLinkIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); diagramLinkIdElement.InnerText = diagramLinkGuid2; if (diagramLinkType == SysmlConstants.SYSMLMESSAGE) { XmlElement relMetadataElement = xmlDocument.CreateElement(relationshipConstants.relMetadata); - relMetadataElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + relMetadataElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement sequenceNumElement = xmlDocument.CreateElement(relationshipConstants.messageNumber); - sequenceNumElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + sequenceNumElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); sequenceNumElement.InnerText = connectorElement.SequenceNo.ToString(); relMetadataElement.AppendChild(sequenceNumElement); diagramLinkElement.AppendChild(relMetadataElement); @@ -784,14 +781,14 @@ public void UnpackageDiagram(EA.Diagram diagram, XmlDocument xmlDocument, string // Create has parent relationship XmlElement hasParentElement = xmlDocument.CreateElement(relationshipConstants.hasParent); - hasParentElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + hasParentElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement hasParentTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - hasParentTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hasParentTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentTypeElement.InnerText = parentType; XmlElement hasParentIdElement = xmlDocument.CreateElement(relationshipConstants.id); - hasParentIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hasParentIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentIdElement.InnerText = parentGuid; hasParentElement.AppendChild(hasParentTypeElement); @@ -820,13 +817,13 @@ public void UnpackageConnector(Connector connector, XmlDocument xmlDocument, { try { - XmlElement dataElement = xmlDocument.CreateElement(hudsConstants.data); - XmlElement attributesElement = xmlDocument.CreateElement(hudsConstants.attributes); - attributesElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); - XmlElement typeElement = xmlDocument.CreateElement(hudsConstants.type); - typeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); - XmlElement relationshipsElement = xmlDocument.CreateElement(hudsConstants.relationships); - relationshipsElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + XmlElement dataElement = xmlDocument.CreateElement(HUDSConstants.DATA); + XmlElement attributesElement = xmlDocument.CreateElement(HUDSConstants.ATTRIBUTES); + attributesElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); + XmlElement typeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + typeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); + XmlElement relationshipsElement = xmlDocument.CreateElement(HUDSConstants.RELATIONSHIPS); + relationshipsElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); string connectorGuid = connector.ConnectorGUID.Substring(1, connector.ConnectorGUID.Length - 2); string supplierGuid = repository.GetElementByID(connector.SupplierID).ElementGUID; @@ -847,40 +844,40 @@ public void UnpackageConnector(Connector connector, XmlDocument xmlDocument, // Create id element to be added to data element XmlElement idElement = MTIPCommon.CreateIdElement(xmlDocument, connectorGuid); - if (connector.Name != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, hudsConstants.str, connector.Name, attributesElement); + if (connector.Name != "") CreateHUDSAttribute(xmlDocument, AttributeConstants.NAME, HUDSConstants.STR, connector.Name, attributesElement); if (connector.Stereotype != "") { XmlElement stereotypeAttribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - stereotypeAttribute.SetAttribute(hudsConstants.dtype, hudsConstants.dict); - stereotypeAttribute.SetAttribute(hudsConstants.key, AttributeConstants.STEREOTYPE); + stereotypeAttribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); + stereotypeAttribute.SetAttribute(HUDSConstants.KEY, AttributeConstants.STEREOTYPE); XmlElement stereotypeNameAttribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - stereotypeNameAttribute.SetAttribute(hudsConstants.dtype, hudsConstants.str); - stereotypeNameAttribute.SetAttribute(hudsConstants.key, AttributeConstants.STEREOTYPENAME); + stereotypeNameAttribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); + stereotypeNameAttribute.SetAttribute(HUDSConstants.KEY, AttributeConstants.STEREOTYPENAME); stereotypeNameAttribute.InnerText = connector.Stereotype; stereotypeAttribute.AppendChild(stereotypeNameAttribute); attributesElement.AppendChild(stereotypeAttribute); } - if (connector.TransitionAction != "" && (connector.TransitionAction != blockConstants.signal || connector.TransitionAction != "Call")) CreateHUDSAttribute(xmlDocument, relationshipConstants.effect, hudsConstants.str, connector.TransitionAction, attributesElement); - if (connector.TransitionGuard != "") CreateHUDSAttribute(xmlDocument, relationshipConstants.guard, hudsConstants.str, connector.TransitionGuard, attributesElement); - if (connector.TransitionAction == blockConstants.signal && connector.TransitionEvent == "Asynchronous") + if (connector.TransitionAction != "" && (connector.TransitionAction != BlockConstants.SIGNAL || connector.TransitionAction != "Call")) CreateHUDSAttribute(xmlDocument, relationshipConstants.effect, HUDSConstants.STR, connector.TransitionAction, attributesElement); + if (connector.TransitionGuard != "") CreateHUDSAttribute(xmlDocument, relationshipConstants.guard, HUDSConstants.STR, connector.TransitionGuard, attributesElement); + if (connector.TransitionAction == BlockConstants.SIGNAL && connector.TransitionEvent == "Asynchronous") { - CreateHUDSAttribute(xmlDocument, AttributeConstants.MESSAGESORT, hudsConstants.str, relationshipConstants.asynchSignal, attributesElement); + CreateHUDSAttribute(xmlDocument, AttributeConstants.MESSAGESORT, HUDSConstants.STR, relationshipConstants.asynchSignal, attributesElement); foreach (EA.ConnectorTag tag in connector.TaggedValues) { if (tag.Name == relationshipConstants.signalGuid && tag.Value != "") { XmlElement signalRelElement = xmlDocument.CreateElement(relationshipConstants.signature); - signalRelElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + signalRelElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement signalTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - signalTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + signalTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); signalTypeElement.InnerText = SysmlConstants.SYSMLSIGNAL; XmlElement signalIdElement = xmlDocument.CreateElement(relationshipConstants.id); - signalIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + signalIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); signalIdElement.InnerText = tag.Value.Substring(1, tag.Value.Length - 2); signalRelElement.AppendChild(signalTypeElement); @@ -889,23 +886,23 @@ public void UnpackageConnector(Connector connector, XmlDocument xmlDocument, } } } - if (connector.TransitionAction == "Call" && connector.TransitionEvent == "Asynchronous") CreateHUDSAttribute(xmlDocument, AttributeConstants.MESSAGESORT, hudsConstants.str, relationshipConstants.asynchCall, attributesElement); - if (connector.TransitionAction == "Call" && connector.TransitionEvent == "Synchronous") CreateHUDSAttribute(xmlDocument, AttributeConstants.MESSAGESORT, hudsConstants.str, relationshipConstants.synchCall, attributesElement); + if (connector.TransitionAction == "Call" && connector.TransitionEvent == "Asynchronous") CreateHUDSAttribute(xmlDocument, AttributeConstants.MESSAGESORT, HUDSConstants.STR, relationshipConstants.asynchCall, attributesElement); + if (connector.TransitionAction == "Call" && connector.TransitionEvent == "Synchronous") CreateHUDSAttribute(xmlDocument, AttributeConstants.MESSAGESORT, HUDSConstants.STR, relationshipConstants.synchCall, attributesElement); - CreateHUDSAttribute(xmlDocument, "isInclusiveOfBaseClass", hudsConstants.str, "false", attributesElement); + CreateHUDSAttribute(xmlDocument, "isInclusiveOfBaseClass", HUDSConstants.STR, "false", attributesElement); // Create client relationship string clientType = GetSysMLType(clientElement.Type, clientElement.Stereotype, clientElement.Subtype, clientElement.MetaType); string supplierType = GetSysMLType(supplierElement.Type, supplierElement.Stereotype, clientElement.Subtype, supplierElement.MetaType); XmlElement clientRelElement = xmlDocument.CreateElement(relationshipConstants.client); - clientRelElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + clientRelElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement clientTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - clientTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + clientTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); clientTypeElement.InnerText = supplierType; XmlElement clientIdElement = xmlDocument.CreateElement(relationshipConstants.id); - clientIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + clientIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); clientIdElement.InnerText = supplierGuid; clientRelElement.AppendChild(clientTypeElement); @@ -914,14 +911,14 @@ public void UnpackageConnector(Connector connector, XmlDocument xmlDocument, // Create supplier relationship XmlElement supplierRelElement = xmlDocument.CreateElement(relationshipConstants.supplier); - supplierRelElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + supplierRelElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement supplierTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - supplierTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + supplierTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); supplierTypeElement.InnerText = clientType; XmlElement supplierIdElement = xmlDocument.CreateElement(relationshipConstants.id); - supplierIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + supplierIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); supplierIdElement.InnerText = clientGuid; supplierRelElement.AppendChild(supplierTypeElement); @@ -930,14 +927,14 @@ public void UnpackageConnector(Connector connector, XmlDocument xmlDocument, // Create has parent relationship XmlElement hasParentElement = xmlDocument.CreateElement(relationshipConstants.hasParent); - hasParentElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + hasParentElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement hasParentTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - hasParentTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hasParentTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentTypeElement.InnerText = parentType; XmlElement hasParentIdElement = xmlDocument.CreateElement(relationshipConstants.id); - hasParentIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hasParentIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentIdElement.InnerText = parentGuid; hasParentElement.AppendChild(hasParentTypeElement); @@ -994,11 +991,11 @@ public string GetPackageType(EA.Package package) public void CreateHUDSAttribute(XmlDocument xmlDocument, string key, string type, string value, XmlElement parentElement) { XmlElement attribute = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attribute.SetAttribute(hudsConstants.key, key); - attribute.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + attribute.SetAttribute(HUDSConstants.KEY, key); + attribute.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement attributeAttrib = xmlDocument.CreateElement(AttributeConstants.ATTRIBUTE); - attributeAttrib.SetAttribute(hudsConstants.key, hudsConstants.value); - attributeAttrib.SetAttribute(hudsConstants.dtype, type); + attributeAttrib.SetAttribute(HUDSConstants.KEY, HUDSConstants.VALUE); + attributeAttrib.SetAttribute(HUDSConstants.DTYPE, type); attributeAttrib.InnerText = value; attribute.AppendChild(attributeAttrib); parentElement.AppendChild(attribute); @@ -1006,26 +1003,26 @@ public void CreateHUDSAttribute(XmlDocument xmlDocument, string key, string type public void CreateConstraintNode(XmlDocument xmlDocument, string constraintGuid, string opaqueExpressionGuid, string parentGuid, string parentType) { // Create constraint data block - XmlElement dataElement = xmlDocument.CreateElement(hudsConstants.data); - XmlElement typeElement = xmlDocument.CreateElement(hudsConstants.type); - typeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement dataElement = xmlDocument.CreateElement(HUDSConstants.DATA); + XmlElement typeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + typeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); typeElement.InnerText = SysmlConstants.SYSMLCONSTRAINT; - XmlElement relationshipsElement = xmlDocument.CreateElement(hudsConstants.relationships); - relationshipsElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + XmlElement relationshipsElement = xmlDocument.CreateElement(HUDSConstants.RELATIONSHIPS); + relationshipsElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); // Create id element to be added to constraint data element XmlElement idElement = MTIPCommon.CreateIdElement(xmlDocument, constraintGuid); // Create constraint relationship XmlElement valueSpecificationElement = xmlDocument.CreateElement(relationshipConstants.valueSpecification); - valueSpecificationElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + valueSpecificationElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement valueSpecTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - valueSpecTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + valueSpecTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); valueSpecTypeElement.InnerText = SysmlConstants.OPAQUEEXPRESSION; XmlElement valueSpecIdElement = xmlDocument.CreateElement(relationshipConstants.id); - valueSpecIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + valueSpecIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); valueSpecIdElement.InnerText = opaqueExpressionGuid; valueSpecificationElement.AppendChild(valueSpecTypeElement); @@ -1033,14 +1030,14 @@ public void CreateConstraintNode(XmlDocument xmlDocument, string constraintGuid, relationshipsElement.AppendChild(valueSpecificationElement); XmlElement hasParentElement = xmlDocument.CreateElement(relationshipConstants.hasParent); - hasParentElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + hasParentElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); XmlElement hasParentTypeElement = xmlDocument.CreateElement(relationshipConstants.type); - hasParentTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hasParentTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentTypeElement.InnerText = parentType; XmlElement hasParentIdElement = xmlDocument.CreateElement(relationshipConstants.id); - hasParentIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + hasParentIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentIdElement.InnerText = parentGuid; hasParentElement.AppendChild(hasParentTypeElement); @@ -1057,14 +1054,14 @@ public void CreateConstraintNode(XmlDocument xmlDocument, string constraintGuid, public void CreateOpaqueNode(XmlDocument xmlDocument, string opaqueGuid, string name, string parentGuid) { // Create constraint data block - XmlElement dataElement = xmlDocument.CreateElement(hudsConstants.data); - XmlElement typeElement = xmlDocument.CreateElement(hudsConstants.type); - typeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement dataElement = xmlDocument.CreateElement(HUDSConstants.DATA); + XmlElement typeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + typeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); typeElement.InnerText = SysmlConstants.SYSMLOPAQUEEXPRESSION; - XmlElement attributesElement = xmlDocument.CreateElement(hudsConstants.attributes); - attributesElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); - XmlElement relationshipsElement = xmlDocument.CreateElement(hudsConstants.relationships); - relationshipsElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + XmlElement attributesElement = xmlDocument.CreateElement(HUDSConstants.ATTRIBUTES); + attributesElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); + XmlElement relationshipsElement = xmlDocument.CreateElement(HUDSConstants.RELATIONSHIPS); + relationshipsElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); // Create id element to be added to opaque expression data element @@ -1072,14 +1069,14 @@ public void CreateOpaqueNode(XmlDocument xmlDocument, string opaqueGuid, string // Create opaque expression relationship XmlElement hasParentElement = xmlDocument.CreateElement(relationshipConstants.hasParent); - hasParentElement.SetAttribute(hudsConstants.dtype, hudsConstants.dict); + hasParentElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.DICT); - XmlElement hasParentTypeElement = xmlDocument.CreateElement(hudsConstants.type); - hasParentTypeElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement hasParentTypeElement = xmlDocument.CreateElement(HUDSConstants.TYPE); + hasParentTypeElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentTypeElement.InnerText = SysmlConstants.SYSMLCONSTRAINT; - XmlElement hasParentIdElement = xmlDocument.CreateElement(hudsConstants.id); - hasParentIdElement.SetAttribute(hudsConstants.dtype, hudsConstants.str); + XmlElement hasParentIdElement = xmlDocument.CreateElement(HUDSConstants.ID); + hasParentIdElement.SetAttribute(HUDSConstants.DTYPE, HUDSConstants.STR); hasParentIdElement.InnerText = parentGuid; hasParentElement.AppendChild(hasParentTypeElement); @@ -1087,7 +1084,7 @@ public void CreateOpaqueNode(XmlDocument xmlDocument, string opaqueGuid, string relationshipsElement.AppendChild(hasParentElement); // Create opaque expression relationship - CreateHUDSAttribute(xmlDocument, AttributeConstants.BODY, hudsConstants.str, name, attributesElement); + CreateHUDSAttribute(xmlDocument, AttributeConstants.BODY, HUDSConstants.STR, name, attributesElement); // Add type, id, attributes, and relationships node to data node dataElement.AppendChild(typeElement); @@ -1100,8 +1097,7 @@ public void CreateOpaqueNode(XmlDocument xmlDocument, string opaqueGuid, string private string GetSysMLType(string type, string stereotype, int subtype, string metatype) { StereotypeConstants stereotypeConstants = new StereotypeConstants(); - MetatypeConstants metatypeConstants = new MetatypeConstants(); - + string elementType = ""; if (stereotype == stereotypeConstants.block) elementType = SysmlConstants.SYSMLBLOCK; else if (stereotype == stereotypeConstants.hardware) elementType = SysmlConstants.SYSMLBLOCK; @@ -1213,17 +1209,17 @@ private string GetSysMLType(string type, string stereotype, int subtype, string type == SysmlConstants.ACTIONPIN || type == SysmlConstants.EVENT) { 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; - else if (type == SysmlConstants.ACTION && metatype == metatypeConstants.destroyObjectAction) elementType = SysmlConstants.SYSMLDESTROYOBJECTACTION; - else if (type == SysmlConstants.ACTION && metatype == metatypeConstants.callOperationAction) elementType = SysmlConstants.SYSMLCALLOPERATIONACTION; - 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 && 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; + else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.destroyObjectAction) elementType = SysmlConstants.SYSMLDESTROYOBJECTACTION; + else if (type == SysmlConstants.ACTION && metatype == MetatypeConstants.callOperationAction) elementType = SysmlConstants.SYSMLCALLOPERATIONACTION; + 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 || 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) { diff --git a/MTIP/Translations/MTIPImportFunctions.cs b/MTIP/Translations/MTIPImportFunctions.cs index 8fea40e..9f9c16a 100644 --- a/MTIP/Translations/MTIPImportFunctions.cs +++ b/MTIP/Translations/MTIPImportFunctions.cs @@ -215,7 +215,7 @@ internal void GetSysmlMTIPModel(EA.Package rootPkg, XmlNode packet) // Begin building model internal void BuildModel(EA.Package rootPkg) { - ModelConstants modelConstants = new ModelConstants(); + try { if (terms.Count > 0) @@ -234,28 +234,28 @@ internal void BuildModel(EA.Package rootPkg) if (headModelItem.GetName() == "") { name = "Model"; - headModelItem.AddAttribute(modelConstants.stereotype, modelConstants.model); + headModelItem.AddAttribute(ModelConstants.STEREOTYPE, ModelConstants.MODEL); } else name = headModelItem.GetName(); EA.Package modelPkg = rootPkg.Packages.AddNew(name, ""); modelPkg.Update(); - if (headModelItem.GetAttributes().ContainsKey(modelConstants.stereotype) && headModelItem.GetAttribute(modelConstants.stereotype) == modelConstants.model) + if (headModelItem.GetAttributes().ContainsKey(ModelConstants.STEREOTYPE) && headModelItem.GetAttribute(ModelConstants.STEREOTYPE) == ModelConstants.MODEL) { - modelPkg.Element.Stereotype = modelConstants.model; + modelPkg.Element.Stereotype = ModelConstants.MODEL; } - if (headModelItem.GetAttributes().ContainsKey(modelConstants.stereotype) && headModelItem.GetAttribute(modelConstants.stereotype) == modelConstants.profile) + if (headModelItem.GetAttributes().ContainsKey(ModelConstants.STEREOTYPE) && headModelItem.GetAttribute(ModelConstants.STEREOTYPE) == ModelConstants.PROFILE) { - modelPkg.Element.Stereotype = modelConstants.profile; + modelPkg.Element.Stereotype = ModelConstants.PROFILE; } string notes = ""; - if (headModelItem.GetAttributes().ContainsKey(modelConstants.documentation)) + if (headModelItem.GetAttributes().ContainsKey(ModelConstants.DOCUMENTATION)) { - notes += headModelItem.GetAttribute(modelConstants.documentation); + notes += headModelItem.GetAttribute(ModelConstants.DOCUMENTATION); } - if (headModelItem.GetAttributes().ContainsKey(modelConstants.text)) + if (headModelItem.GetAttributes().ContainsKey(ModelConstants.TEXT)) { - notes = " - " + headModelItem.GetAttribute(modelConstants.text); + notes = " - " + headModelItem.GetAttribute(ModelConstants.TEXT); } modelPkg.Notes = notes; modelPkg.Update(); @@ -751,10 +751,6 @@ internal void AddElementElement(string parentId, string childId) internal void GetElement(EA.Element childElement, XmlItem childItem, string childId, string parentType) { StereotypeConstants stereotypeConstants = new StereotypeConstants(); - MetatypeConstants metatypeConstants = new MetatypeConstants(); - ProfileConstants profileConstants = new ProfileConstants(); - - if (childElement.Type == SysmlConstants.STATENODE) { if (childItem.GetElementType() == SysmlConstants.INITIALPSEUDOSTATE) childElement.Subtype = 3; @@ -768,7 +764,7 @@ internal void GetElement(EA.Element childElement, XmlItem childItem, string chil if (childItem.GetElementType() == SysmlConstants.ACTIVITYINITIALNODE) childElement.Subtype = 100; if (childItem.GetElementType() == SysmlConstants.ACTIVITYFINALNODE) childElement.Subtype = 101; if (childItem.GetElementType() == SysmlConstants.FLOWFINALNODE) childElement.Subtype = 102; - childElement.MetaType = metatypeConstants.pseudostate; + childElement.MetaType = MetatypeConstants.pseudostate; } if (childElement.Type == SysmlConstants.ACTION) { @@ -1521,15 +1517,15 @@ internal void AddCompositeDiagrams() internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair diagramItem) { - DiagramConstants diagramConstants = new DiagramConstants(); + EA.Package pkg = repository.GetPackageByID(1); - EA.Diagram relationshipDiagram = repository.GetPackageByID(1).Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.component); ; + EA.Diagram relationshipDiagram = repository.GetPackageByID(1).Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.component); ; if (parentItem.GetElementType() == SysmlConstants.PACKAGE || parentItem.GetElementType() == SysmlConstants.PROFILE || parentItem.GetElementType() == SysmlConstants.MODEL) { EA.Package parentPkg = repository.GetPackageByGuid(parentItem.GetEAID()); if (diagramItem.Value.GetElementType() == SysmlConstants.ACT) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.activity); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.activity); relationshipDiagram.MetaType = "SysML1.4::Activity"; relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); @@ -1537,7 +1533,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.BDD) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.logical); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.logical); relationshipDiagram.MetaType = "SysML1.4::BlockDefinition"; relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); @@ -1545,14 +1541,14 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.CLASS) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.classType); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.classType); relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); return relationshipDiagram; } if (diagramItem.Value.GetElementType() == SysmlConstants.IBD) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.compositeStructure); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.compositeStructure); relationshipDiagram.MetaType = "SysML1.4::InternalBlock"; relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); @@ -1560,14 +1556,14 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.PACKAGE) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.package); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.package); relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); return relationshipDiagram; } if (diagramItem.Value.GetElementType() == SysmlConstants.PAR) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.compositeStructure); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.compositeStructure); relationshipDiagram.MetaType = "SysML1.4::Parametric"; relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); @@ -1575,7 +1571,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.REQ) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.custom); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.custom); relationshipDiagram.MetaType = "SysML1.4::Requirement"; relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); @@ -1583,7 +1579,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.SEQ) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.sequence); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.sequence); relationshipDiagram.MetaType = "SysML1.4::Sequence"; relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); @@ -1591,7 +1587,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.STM) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.statechart); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.statechart); relationshipDiagram.MetaType = "SysML1.4::StateMachine"; relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); @@ -1599,7 +1595,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.UC) { - relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.useCase); + relationshipDiagram = parentPkg.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.useCase); relationshipDiagram.MetaType = "SysML1.4::UseCase"; relationshipDiagram.Update(); parentPkg.Diagrams.Refresh(); @@ -1609,9 +1605,9 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair else if (parentItem.GetCategory() == SysmlConstants.ELEMENT) { EA.Element parentElement = repository.GetElementByGuid(parentItem.GetEAID()); - if (diagramItem.Value.GetElementType() == SysmlConstants.ACT && parentItem.GetEAID() != diagramConstants.activity) + if (diagramItem.Value.GetElementType() == SysmlConstants.ACT && parentItem.GetEAID() != DiagramConstants.activity) { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.activity); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.activity); relationshipDiagram.MetaType = "SysML1.4::Activity"; relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); @@ -1620,7 +1616,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair if (diagramItem.Value.GetElementType() == SysmlConstants.BDD && parentItem.GetEAID() != "") { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.logical); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.logical); relationshipDiagram.MetaType = "SysML1.4::BlockDefinition"; relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); @@ -1628,14 +1624,14 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.CLASS && parentItem.GetEAID() != "") { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.classType); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.classType); relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); return relationshipDiagram; } if (diagramItem.Value.GetElementType() == SysmlConstants.IBD && parentItem.GetEAID() != "") { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.compositeStructure); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.compositeStructure); relationshipDiagram.MetaType = "SysML1.4::InternalBlock"; relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); @@ -1643,14 +1639,14 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.PACKAGE && parentItem.GetEAID() != "") { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.package); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.package); relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); return relationshipDiagram; } if (diagramItem.Value.GetElementType() == SysmlConstants.PAR && parentItem.GetEAID() != "") { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.compositeStructure); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.compositeStructure); relationshipDiagram.MetaType = "SysML1.4::Parametric"; relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); @@ -1658,7 +1654,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.REQ) { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.custom); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.custom); relationshipDiagram.MetaType = "SysML1.4::Requirement"; relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); @@ -1666,7 +1662,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.SEQ && parentItem.GetEAID() != "") { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.sequence); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.sequence); relationshipDiagram.MetaType = "SysML1.4::Sequence"; relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); @@ -1674,7 +1670,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.STM && parentItem.GetEAID() != "") { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.statechart); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.statechart); relationshipDiagram.MetaType = "SysML1.4::StateMachine"; relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); @@ -1682,7 +1678,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } if (diagramItem.Value.GetElementType() == SysmlConstants.UC && parentItem.GetEAID() != "") { - relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.useCase); + relationshipDiagram = parentElement.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.useCase); relationshipDiagram.MetaType = "SysML1.4::UseCase"; relationshipDiagram.Update(); parentElement.Diagrams.Refresh(); @@ -1692,7 +1688,7 @@ internal EA.Diagram GetDiagram(XmlItem parentItem, KeyValuePair } else { - relationshipDiagram = orphanedPackage.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), diagramConstants.component); + relationshipDiagram = orphanedPackage.Diagrams.AddNew(diagramItem.Value.GetAttribute(AttributeConstants.NAME), DiagramConstants.component); relationshipDiagram.Update(); orphanedPackage.Diagrams.Refresh(); return relationshipDiagram; @@ -1812,132 +1808,132 @@ public bool IsPortType(string type) internal string GetEAType(string sysmlType, string stereotype) { StereotypeConstants stereotypeConstants = new StereotypeConstants(); - ActivityConstants activityConstants = new ActivityConstants(); - BlockConstants blockConstants = new BlockConstants(); + + UseCaseConstants useCaseConstants = new UseCaseConstants(); - InternalBlockConstants internalBlockConstants = new InternalBlockConstants(); + RequirementConstants requirementConstants = new RequirementConstants(); - ProfileConstants profileConstants = new ProfileConstants(); + SequenceConstants sequenceConstants = new SequenceConstants(); StateMachineConstants stateMachineConstants = new StateMachineConstants(); string type = ""; - if (sysmlType == SysmlConstants.ACTIVITY) type = activityConstants.activity; - else if (sysmlType == SysmlConstants.ACTIVITYFINALNODE) type = activityConstants.stateNode; - else if (sysmlType == SysmlConstants.ACTIVITYPARAMETERNODE) type = activityConstants.activityParameter; - else if (sysmlType == SysmlConstants.ACTIVITYPARTITION) type = activityConstants.activityPartion; + if (sysmlType == SysmlConstants.ACTIVITY) type = ActivityConstants.ACTIVITY; + else if (sysmlType == SysmlConstants.ACTIVITYFINALNODE) type = ActivityConstants.STATENODE; + else if (sysmlType == SysmlConstants.ACTIVITYPARAMETERNODE) type = ActivityConstants.ACTIVITYPARAMETER; + else if (sysmlType == SysmlConstants.ACTIVITYPARTITION) type = ActivityConstants.ACTIVITYPARTION; else if (sysmlType == SysmlConstants.BLOCK) { - if (stereotype == stereotypeConstants.constraintBlockCap || stereotype == stereotypeConstants.constraintBlock) type = blockConstants.constraintBlock; - else type = blockConstants.block; + 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.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.ASSOCIATIONBLOCK) type = blockConstants.association; - else if (sysmlType == SysmlConstants.BOUNDREFERENCE) type = internalBlockConstants.boundReference; - else if (sysmlType == SysmlConstants.BOUNDARY) type = internalBlockConstants.boundary; + else if (sysmlType == SysmlConstants.ASSOCIATIONBLOCK) type = BlockConstants.ASSOCIATION; + else if (sysmlType == SysmlConstants.BOUNDREFERENCE) type = InternalBlockConstants.BOUNDREFERENCE; + else if (sysmlType == SysmlConstants.BOUNDARY) type = InternalBlockConstants.BOUNDARY; else if (sysmlType == SysmlConstants.BUSINESSREQUIREMENT) type = requirementConstants.requirement; - else if (sysmlType == SysmlConstants.CLASSIFIERBEHAVIORPROPERTY) type = internalBlockConstants.property; - else if (sysmlType == SysmlConstants.CALLBEHAVIORACTION) type = activityConstants.callBehaviorAction; - else if (sysmlType == SysmlConstants.CALLOPERATIONACTION) type = activityConstants.callOperationAction; - else if (sysmlType == SysmlConstants.CENTRALBUFFERNODE) type = activityConstants.centralBufferNode; - else if (sysmlType == SysmlConstants.CHANGE) type = activityConstants.change; - else if (sysmlType == SysmlConstants.CHOICEPSUEDOSTATE) type = activityConstants.stateNode; - else if (sysmlType == SysmlConstants.CLASS) type = profileConstants.classType; - else if (sysmlType == SysmlConstants.CLASSIFICATION) type = profileConstants.part; + else if (sysmlType == SysmlConstants.CLASSIFIERBEHAVIORPROPERTY) type = InternalBlockConstants.PROPERTY; + else if (sysmlType == SysmlConstants.CALLBEHAVIORACTION) type = ActivityConstants.CALLBEHAVIORACTION; + else if (sysmlType == SysmlConstants.CALLOPERATIONACTION) type = ActivityConstants.CALLOPERATIONACTION; + else if (sysmlType == SysmlConstants.CENTRALBUFFERNODE) type = ActivityConstants.CENTRALBUFFERNODE; + else if (sysmlType == SysmlConstants.CHANGE) type = ActivityConstants.CHANGE; + else if (sysmlType == SysmlConstants.CHOICEPSUEDOSTATE) type = ActivityConstants.STATENODE; + else if (sysmlType == SysmlConstants.CLASS) type = ProfileConstants.CLASSTYPE; + else if (sysmlType == SysmlConstants.CLASSIFICATION) type = ProfileConstants.PART; else if (sysmlType == SysmlConstants.COLLABORATION) type = sequenceConstants.collaboration; - else if (sysmlType == SysmlConstants.CONSTRAINTBLOCK) type = blockConstants.constraintBlock; - else if (sysmlType == SysmlConstants.CONSTRAINT) type = profileConstants.constraint; - else if (sysmlType == SysmlConstants.CONSTRAINTBLOCK) type = blockConstants.block; - else if (sysmlType == SysmlConstants.CONSTRAINTPARAMETER) type = activityConstants.property; - else if (sysmlType == SysmlConstants.CONDITIONALNODE) type = activityConstants.conditionalNode; + else if (sysmlType == SysmlConstants.CONSTRAINTBLOCK) type = BlockConstants.CONSTRAINTBLOCK; + else if (sysmlType == SysmlConstants.CONSTRAINT) type = ProfileConstants.CONSTRAINT; + else if (sysmlType == SysmlConstants.CONSTRAINTBLOCK) type = BlockConstants.BLOCK; + else if (sysmlType == SysmlConstants.CONSTRAINTPARAMETER) type = ActivityConstants.PROPERTY; + else if (sysmlType == SysmlConstants.CONDITIONALNODE) type = ActivityConstants.CONDITIONALNODE; else if (sysmlType == SysmlConstants.COMBINEDFRAGMENT) type = sequenceConstants.interactionFragment; - 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.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.DESIGNCONSTRAINT) type = requirementConstants.designConstraint; - else if (sysmlType == SysmlConstants.DESTROYOBJECTACTION) type = activityConstants.destroyObjectAction; - else if (sysmlType == SysmlConstants.DOMAIN) type = blockConstants.block; + 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.ENUMERATION) type = blockConstants.enumeration; - else if (sysmlType == SysmlConstants.EVENT) type = activityConstants.eventType; - else if (sysmlType == SysmlConstants.EXCEPTIONHANDLER) type = profileConstants.exceptionHandler; + 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.EXTERNAL) type = blockConstants.external; + else if (sysmlType == SysmlConstants.EXTERNAL) type = BlockConstants.EXTERNAL; else if (sysmlType == SysmlConstants.LIFELINE) type = sequenceConstants.sequence; - else if (sysmlType == SysmlConstants.PACKAGE) type = profileConstants.package; - else if (sysmlType == SysmlConstants.PROPERTY) type = internalBlockConstants.property; - else if (sysmlType == SysmlConstants.PORT) type = blockConstants.port; - else if (sysmlType == SysmlConstants.PROXYPORT) type = blockConstants.proxyPort; - else if (sysmlType == SysmlConstants.FINALSTATE) type = activityConstants.stateNode; - else if (sysmlType == SysmlConstants.FULLPORT) type = blockConstants.fullPort; - else if (sysmlType == SysmlConstants.FLOWFINALNODE) type = activityConstants.stateNode; - else if (sysmlType == SysmlConstants.FLOWPORT) type = blockConstants.flowPort; + else if (sysmlType == SysmlConstants.PACKAGE) type = ProfileConstants.PACKAGE; + else if (sysmlType == SysmlConstants.PROPERTY) type = InternalBlockConstants.PROPERTY; + else if (sysmlType == SysmlConstants.PORT) type = BlockConstants.PORT; + else if (sysmlType == SysmlConstants.PROXYPORT) type = BlockConstants.PROXYPORT; + else if (sysmlType == SysmlConstants.FINALSTATE) type = ActivityConstants.STATENODE; + else if (sysmlType == SysmlConstants.FULLPORT) type = BlockConstants.FULLPORT; + else if (sysmlType == SysmlConstants.FLOWFINALNODE) type = ActivityConstants.STATENODE; + else if (sysmlType == SysmlConstants.FLOWPORT) type = BlockConstants.FLOWPORT; else if (sysmlType == SysmlConstants.FUNCTIONALREQUIREMENT) type = requirementConstants.functionalRequirement; - else if (sysmlType == SysmlConstants.HYPERLINK) type = profileConstants.text; - else if (sysmlType == SysmlConstants.INFORMATIONITEM) type = activityConstants.informationItem; - else if (sysmlType == SysmlConstants.INITIALPSEUDOSTATE) type = activityConstants.stateNode; - else if (sysmlType == SysmlConstants.INPUTPIN) type = activityConstants.actionPin; + else if (sysmlType == SysmlConstants.HYPERLINK) type = ProfileConstants.TEXT; + else if (sysmlType == SysmlConstants.INFORMATIONITEM) type = ActivityConstants.INFORMATIONITEM; + else if (sysmlType == SysmlConstants.INITIALPSEUDOSTATE) type = ActivityConstants.STATENODE; + else if (sysmlType == SysmlConstants.INPUTPIN) type = ActivityConstants.ACTIONPIN; else if (sysmlType == SysmlConstants.INTERACTION) type = sequenceConstants.interaction; - else if (sysmlType == SysmlConstants.INTERFACE) type = blockConstants.interfaceType; + else if (sysmlType == SysmlConstants.INTERFACE) type = BlockConstants.INTERFACETYPE; else if (sysmlType == SysmlConstants.INTERFACEREQUIREMENT) type = requirementConstants.interfaceRequirement; - else if (sysmlType == SysmlConstants.INTERFACEBLOCK) type = blockConstants.interfaceBlock; - 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.INTERFACEBLOCK) type = BlockConstants.INTERFACEBLOCK; + 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.NAVIGATIONCELL) type = profileConstants.text; - else if (sysmlType == SysmlConstants.NOTE) type = profileConstants.note; - else if (sysmlType == SysmlConstants.OBJECT) type = profileConstants.objectType; - else if (sysmlType == SysmlConstants.OBJECTNODE) type = activityConstants.objectNode; - else if (sysmlType == SysmlConstants.OBJECTIVEFUNCTION) type = profileConstants.objectiveFunction; - 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.NAVIGATIONCELL) type = ProfileConstants.TEXT; + else if (sysmlType == SysmlConstants.NOTE) type = ProfileConstants.NOTE; + else if (sysmlType == SysmlConstants.OBJECT) type = ProfileConstants.OBJECTTYPE; + else if (sysmlType == SysmlConstants.OBJECTNODE) type = ActivityConstants.OBJECTNODE; + else if (sysmlType == SysmlConstants.OBJECTIVEFUNCTION) type = ProfileConstants.OBJECTIVEFUNCTION; + 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.JOINNODE) type = activityConstants.synchronization; + else if (sysmlType == SysmlConstants.JOINNODE) type = ActivityConstants.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.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.CONSTRAINTPROPERTY) type = internalBlockConstants.constraintProperty; - else if (sysmlType == SysmlConstants.PARTICIPANTPROPERTY) type = internalBlockConstants.participantProperty; + 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.PORT) type = BlockConstants.PORT; + else if (sysmlType == SysmlConstants.SENDSIGNALACTION) type = ActivityConstants.SENDSIGNALACTION; 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.SIGNAL) type = BlockConstants.SIGNAL; + else if (sysmlType == SysmlConstants.STEREOTYPE) type = ProfileConstants.CLASSTYPE; 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.SUBSYSTEM) type = blockConstants.block; + else if (sysmlType == SysmlConstants.SUBSYSTEM) type = BlockConstants.BLOCK; 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.SYSTEM) type = BlockConstants.BLOCK; + else if (sysmlType == SysmlConstants.SYSTEMCONTEXT) type = BlockConstants.BLOCK; else if (sysmlType == SysmlConstants.TERMINATE) type = stateMachineConstants.stateNode; - else if (sysmlType == SysmlConstants.TEXT) type = profileConstants.text; + else if (sysmlType == SysmlConstants.TEXT) type = ProfileConstants.TEXT; else if (sysmlType == SysmlConstants.TRIGGER) type = stateMachineConstants.trigger; - else if (sysmlType == SysmlConstants.UNIT) type = blockConstants.unit; + else if (sysmlType == SysmlConstants.UNIT) type = BlockConstants.UNIT; 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; + else if (sysmlType == SysmlConstants.QUANTITYKIND) type = BlockConstants.QUANTITYKIND; + else if (sysmlType == SysmlConstants.VALUETYPE) type = BlockConstants.VALUETYPE; + else if (sysmlType == SysmlConstants.FLOWSPECIFICATION) type = BlockConstants.INTERFACETYPE; return type; } private string GetSysMLType(string type, string stereotype, int subtype, string metatype) { StereotypeConstants stereotypeConstants = new StereotypeConstants(); - MetatypeConstants metatypeConstants = new MetatypeConstants(); + string elementType = ""; if (stereotype == stereotypeConstants.block) elementType = SysmlConstants.SYSMLBLOCK; @@ -2046,10 +2042,10 @@ private string GetSysMLType(string type, string stereotype, int subtype, string type == SysmlConstants.ACTIONPIN || type == SysmlConstants.EVENT) { 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 && 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;