-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTransformationsOntoUMLtoSML.xml
118 lines (118 loc) · 14.4 KB
/
TransformationsOntoUMLtoSML.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?xml version="1.0" encoding="windows-1252"?>
<RefData version="1.0" exporter="EA.25">
<DataSet name="OntoUML->SML_Transform_Template" table="t_template" filter="TemplateType='#TemplateType#' and TemplateName='#TemplateName#' and Style='#Style#'" stoplist=";TemplateID;">
<DataRow>
<Column name="TemplateID" value="{CA836735-C91A-46bd-BBB3-5F7E6308987F}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="File"/>
<Column name="Template" value="Package
{
 name=%qt%Participants from OntoUML package: %packageName%%qt%
 stereotype="SML"

 %list="Namespace" @separator="\n\n" @indent=""%
 
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{7465C272-9F59-4609-AABF-08156BAD70B3}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Class"/>
<Column name="Template" value="%if elemType != "Class" and elemType != "Interface" and elemType != "Enumeration"%
%endTemplate%

%if elemType=="Class" and classStereotype!="Quantity"%
Class
{
 %TRANSFORM_REFERENCE("Class")%
 %TRANSFORM_CURRENT("language")%
 language="SML"
 %list="ClassBase" @separator="\n" @indent=" "%
 %list="ClassInterface" @separator="\n" @indent=" "%

 name=%qt%%className%%qt%

$COMMENT="TRANSFORM STEREOTYPE ONTOUML -> SML (TABLE 1. SOBRAL THESIS)"
%if classStereotype=="Category" or classStereotype=="Collective" or classStereotype=="Kind" or classStereotype=="Mixin" or classStereotype=="Phase" or classStereotype=="Role" or classStereotype=="RoleMixin" or classStereotype=="SubKind" or classStereotype=="PhaseMixin" %
 stereotype="EntityParticipant"
%elseIf classStereotype=="Mode" %
 stereotype="ModeReference"
%elseIf classStereotype=="Relator" %
 stereotype="RelatorParticipant"
%elseIf classStereotype=="Quality" %
 stereotype="AttributeReference"
%endIf%

%list="Attribute" @separator="\n" @indent=" "%
}

%list="Connector" @separator="\n" @indent=" "%
"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{4AC5CFEE-A6C8-4ca2-A810-D91C04FCFC86}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Namespace"/>
<Column name="Template" value="%list="Namespace" @separator="\n\n" @indent=""%
%list="Class" @separator="\n\n" @indent="" elemType=="Class" or elemType=="Enumeration"%"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{2711E751-4DAA-414a-BD71-A466039E23B2}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Namespace__Interface"/>
<Column name="Template" value="$service = %Namespace__Service%
%if $service!=""%
 ExposedInterface
 {
 %TRANSFORM_REFERENCE("ExposedInterface",packageGUID)%
 name=%qt%%packageName%%qt%
 Classifier
 {
 namespace="WSDL"
 name="Service"
 source=%qt%%packageGUID%%qt%
 }
 }
%endIf%
%list="Namespace__Interface" @separator="\n\n" @indent=""%
"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{C723C443-48D6-40ac-AD43-ED346A2B7A5B}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Namespace__Service"/>
<Column name="Template" value="$interfaces = %list="Class" @separator="\n\n" @indent="" elemType=="Interface"%
%if $interfaces == "" or packageHasGenClasses!="T"%
%endTemplate%

$interfaces
Package
{
 name="Services"
 Interface
 {
 %TRANSFORM_REFERENCE("Service",packageGUID)%
 name=%qt%%packageName%%qt%
 stereotype="WSDLservice"
 }
}
"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{839B4C60-FD89-462b-B864-7A85A1BD33B3}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Class Base"/>
<Column name="Template" value="Parent
{
 name=%qt%%classBaseName%%qt%
 type="Parent"
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{387C3DAC-3967-4bbf-88CE-9803C0E90E61}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Class Interface"/>
<Column name="Template" value="Parent
{
 name=%qt%%classBaseName%%qt%
 type="Implements"
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{2EA9A02A-4BD9-4190-9DC6-48BB9A882231}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Class__Messages"/>
<Column name="Template" value="Package
{
 name="Messages"
%list="Operation__Messages" @separator="\n" @indent=" "%
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{EF3F7E7C-A41C-49e8-8B4B-A41241D8CC17}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Class__Binding"/>
<Column name="Template" value="Package
{
 name="Bindings"
 Class
 {
 %TRANSFORM_REFERENCE("Binding",classGUID)%
 %TRANSFORM_CURRENT("stereotype")%
 stereotype="WSDLbinding"
%list="Operation" @separator="\n" @indent=" "%
 }
}
Realisation
{
 %TRANSFORM_REFERENCE("BindingPortType",classGUID)%
 Source
 {
 %TRANSFORM_REFERENCE("Binding",classGUID)%
 }
 Target
 {
 %TRANSFORM_REFERENCE("PortType",classGUID)%
 }
}
Association
{
 name=%qt%%className%%qt%
 %TRANSFORM_REFERENCE("ServiceBinding",classGUID)%
 Source
 {
 %TRANSFORM_REFERENCE("Service",packageGUID)%
 }
 Target
 {
 %TRANSFORM_REFERENCE("Binding",classGUID)%
 }
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{10516A3D-8591-4313-BCDF-CD2401E99379}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Class__PortType"/>
<Column name="Template" value="Package
{
 name="PortTypes"
 Interface
 {
 %TRANSFORM_REFERENCE("PortType",classGUID)%
 %TRANSFORM_CURRENT("stereotype")%
 stereotype="WSDLportType"
%list="Operation" @separator="\n" @indent=" "%
 }
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{7FC77A85-6EBF-4fa9-8494-AC1FB91A72C6}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Attribute"/>
<Column name="Template" value="%if elemType!="Class" and elemType!="Enumeration"%
%endTemplate%

$COMMENT="CREATES A CLASS TO REPRESENT THE ATTRIBUTE"
Class
{
 name=%qt%%attName%%qt%
 stereotype="AttributeReference"
 %TRANSFORM_REFERENCE("Class",attGUID)%
}

$COMMENT="CREATES THE ASSOCIATION BETWEEN THE CLASS AND THE ATTRIBUTE CREATED (AS CLASS ABOVE)"
Association
{
 stereotype=%qt%SML::AttributeLink%qt%
 
 Source
 {
 %TRANSFORM_REFERENCE("Class",classGUID)%
 
 }
 Target
 {
 %TRANSFORM_REFERENCE("Class",attGUID)%
 
 }
} 

"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{9A82EEF4-3F4F-48bc-97F0-CD83CEFCE584}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Operation"/>
<Column name="Template" value="Operation
{
%TRANSFORM_CURRENT("type")%
 Parameter
 {
 name=%qt%%opName%RequestRequest%qt%
 type=%qt%%opName%Request%qt%
 kind="in"
 }
$return = %Operation__Response%
%if $return!=""%
 Parameter
 {
 name=%qt%%opName%RequestResponse%qt%
 type=%qt%%opName%Response%qt%
 kind="out"
 }
%endIf%
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{56E1C65A-AB1E-453b-A388-3CE074467760}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Operation__Response"/>
<Column name="Template" value="$parts=%list="Parameter__MessagePart" @separator="\n" @indent=" " paramKind=="out" or paramKind=="return"%
%if opReturnType!="" and opReturnType!="void"%
$returns = "T"
%endIf%

%if $parts=="" and $returns!="T"%
%endTemplate%

Class
{
%TRANSFORM_REFERENCE("ReturnMessage",opGUID)%
 name=%qt%%opName%Response%qt%
 stereotype="WSDLmessage"
%if opReturnType!="" and opReturnType!="void"%
 Attribute
 {
 name="return"
 type=%qt%%opReturnType%%qt%
 }
%endIf%
$parts
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{E6FED34F-B53A-4452-8334-8372AAB0776C}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Operation__Messages"/>
<Column name="Template" value="%Operation__Request%
%Operation__Response%"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{93C6A759-C957-4751-B4A5-E50E1277E900}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Operation__Request"/>
<Column name="Template" value="Class
{
%TRANSFORM_REFERENCE("ParamsMessage",opGUID)%
 name=%qt%%opName%Request%qt%
 stereotype="WSDLmessage"
%list="Parameter__MessagePart" @separator="\n" @indent=" " paramKind=="in"%
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{06B275E3-DBB2-4759-964A-11A5E1855027}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Parameter"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{A87A4E89-D004-45e7-932E-1040451798B4}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Parameter__MessagePart"/>
<Column name="Template" value="%if paramType=="" or paramType=="void"%
%endTemplate%

Attribute
{
 name=%qt%%paramName%%qt%
 type=%qt%%paramType%%qt%
 notes=%qt%%paramNotes%%qt%
}"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{E87AACAA-DC74-44f9-8169-344414EF92C1}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Attribute__Generalization"/>
<Column name="Template" value="
$COMMENT="CREATES A CLASS TO REPRESENT THE ATTRIBUTE"
Class
{
 name=%qt%%attName%_%elemType%_%connectorSourceElemName%_%connectorDestElemName%%qt%
 stereotype="AttributeReference"
 %TRANSFORM_REFERENCE("Class",connectorGUID)%
}

"/>
</DataRow>
<DataRow>
<Column name="TemplateID" value="{A41A60B1-0502-4c8b-A875-3C5C382A29E1}"/>
<Column name="TemplateType" value="OntoUML->SML_Transform_Template"/>
<Column name="TemplateName" value="Connector"/>
<Column name="Template" value="%if connectorStereotype!="Characterization" and connectorStereotype!="Mediation" and connectorStereotype!="Formal" and connectorType!="Generalization" %
%endTemplate%

$COMMENT="IF GENERALIZATION, ADD ATTRIBUTES OF THE PARENT TO THE CHILD"
%if connectorType=="Generalization" %

Class
{
 name=%qt%%elemType%_%connectorSourceElemName%_%connectorDestElemName%%qt%
 stereotype="AttributeReference"
 %TRANSFORM_REFERENCE("Class",connectorGUID)%
}

%list="Attribute__Generalization" @separator="\n" @indent=" "%

%else%

$COMMENT="CREATES THE CONNECTOR (ASSOCIATION OR GENERALIZATION)"
%connectorType%
%PI="\n "%
{
 %TRANSFORM_REFERENCE("Connector",connectorGUID)%
 name = %qt%%connectorType%_%connectorStereotype%%qt%
 
 %if connectorStereotype=="Characterization"%
 stereotype=%qt%SML::CharacterizationLink%qt%
 %elseIf connectorStereotype=="Mediation"%
 stereotype=%qt%SML::MediationLink%qt%
 %elseIf connectorStereotype=="Formal"%
 stereotype=%qt%SML::ContextFormalLink%qt%
 %endIf%
 
 %if connectorIsAssociationClass=="T"% 
 AssociationClass
 {
 %TRANSFORM_REFERENCE("Class",connectorAssociationClassElemGUID)%
 }
 %endIf%
 
 Source
 {
 %TRANSFORM_REFERENCE("Class",connectorSourceElemGUID)%
 access=%qt%%connectorSourceAccess == "Public" ? "Private" : value%%qt%
 %TRANSFORM_CURRENT("Source","access")%
 }
 Target
 {
 %TRANSFORM_REFERENCE("Class",connectorDestElemGUID)%
 access=%qt%%connectorDestAccess == "Public" ? "Private" : value%%qt%
 %TRANSFORM_CURRENT("Target","access")%
 %PI="\n"%
 }
}

%endIf%
"/>
</DataRow>
</DataSet>
</RefData>