Ignore Stereotypes of custom profile [message #1791269] |
Wed, 27 June 2018 10:38 |
Steven Schmock Messages: 8 Registered: June 2018 |
Junior Member |
|
|
Hello everybody,
I'm trying to transform a UML model into an ECORE model. I have a custom profile where I have defined several stereotypes for uml elements. First I tried to get the names of all stereotypes that are applied. But only the sysml stereotype block is displayed and not my custom stereotypes. I tried to follow this instruction https://wiki.eclipse.org/ATL/Howtos#How_can_I_retrieve_tagged_values_from_stereotyped_UML_model_elements.3F, but it does not help. Would someone have a hint?
My ATL Code:
module Uml2EcoreTransformation;
create OUT: Documentation from IN: UML, INPROFILE: CustomStereotypes;
helper context UML!Element def: hasStereotype(stereotype: String): Boolean =
self.getAppliedStereotypes() -> collect(st | st.name) -> includes(stereotype);
rule CustomList {
from
s: UML!Class --(s.hasStereotype('Block'))
to
t: Documentation !CustomList (
name <- s.name + ' ' + s.getAppliedStereotypes() -> collect(e | e.name)
)
}
]
My output:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:Documentation ="http:///Documentation .ecore">
<Documentation :CustomList name ="class1 []"/>
<Documentation :CustomList name ="class2 []"/>
<Documentation :CustomList name ="class3 []"/>
<Documentation :CustomList name ="class4 [Block]"/>
<Documentation :CustomList name ="class5 [Block]"/>
<Documentation :CustomList name ="class6 [Block]"/>
</xmi:XMI>
Thanks in advance
[Updated on: Wed, 27 June 2018 10:40] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03836 seconds