Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Stereotypes(conditional generation based on stereotype)
Stereotypes [message #1767033] Thu, 29 June 2017 17:59 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 52
Registered: July 2016
How does one implement a pre condition based on a stereotype?

I have classes in my UML that have been set with stereotypes that came from a profile I created. But no matter what I cannot seem to access the stereotype name as a string. Presumably one can get a stereotype using a classes' qualified name. But I cannot get it to work.


returns a qualified name but


returns nothing.

Ultimately, I'd like to do the following:

[template public generateElement(aClass : Class) ? (aClass.getAppliedStereotype([aClass.getQualifiedName()).name.matches('federate'))]

Thanks again
Re: Stereotypes [message #1767036 is a reply to message #1767033] Thu, 29 June 2017 19:21 Go to previous message
Tomasz  abczy?ski is currently offline Tomasz abczy?skiFriend
Messages: 11
Registered: May 2015
Junior Member
GetAppliedStereotype has stereotype name as a parameter.
so you could write:

The first gives true if setereotype is applied,the second - the stereotype object (note that in the first case getAppliedStereotype_s_ function is used)


Tomasz Babczyński
Previous Topic:Acceleo : How to cast in a Collection ?
Next Topic:Nothing is being generated
Goto Forum:

Current Time: Fri Dec 01 11:25:41 GMT 2023

Powered by FUDForum. Page generated in 0.01953 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top