Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » References to enumerations defined in a profile
References to enumerations defined in a profile [message #1844153] Fri, 03 September 2021 09:50 Go to next message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 152
Registered: July 2014
Senior Member
Dear all,

The transformation I'm working on uses as input a UML model on which profiles have been applied.

Checking stereotypes and tag values using the EMF utilities works fine, but I'm struggling in testing some tag values against literals defined as part of on of those profiles. For instance SysML defines the FlowDirectionKind enumeration. How can I refers to this enumeration ?

I tried defining a "SysML" metamodel in the launch configuration pointing to the SysML.profile.uml I have, so that I can refers to: SysML!FlowDirectionKind, but I get the following error at run time:

org.eclipse.uml.internal.impl.ProfileImpl cannot be cast to org.eclipse.emf.ecore.EPackage



Yves
Re: References to enumerations defined in a profile [message #1844155 is a reply to message #1844153] Fri, 03 September 2021 10:40 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

ATL uses untyped enum literals in its code, e.g.:
publicAttribute.visibility = #public


At runtime, these ATL enum values are converted from/to EMF EEnumLiteral instances. This conversion is performed on assignment ('<-'), comparison ('='), and when passed as a method argument.


Cheers,
Dennis
Re: References to enumerations defined in a profile [message #1844166 is a reply to message #1844155] Fri, 03 September 2021 20:07 Go to previous message
Yves BERNARD is currently offline Yves BERNARDFriend
Messages: 152
Registered: July 2014
Senior Member
Hi Dennis,

Thank you so much for your answer. I'll take it into account.



Yves
Previous Topic:Issue with assignment of a String
Next Topic:ATL question
Goto Forum:
  


Current Time: Fri Apr 26 09:05:11 GMT 2024

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

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

Back to the top