Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] put Model-object as parameter?

Hi Jens,

On 11/14/2012 12:09 PM, Jens Bürger wrote:

Nice way and it seems to solve my problem at this point, too! The only thing I ask myself is: How do I get the EClass for, lets say my UML-Profile-Stereotype? Instantiating the Stereotype by hand via plain Java code would be a way, but this would be rather complex I think, because I would have to do all the linking with Profile metamodel, and so on manually, right?


You would need to load the profile and locate the EClass that represents your stereotype. That should be fairly easy. Looking at your file UMLsec.profile.uml, the top-level element of this file is an instance of "Profile". In that profile, you locate the EAnnotation with the ID "http://www.eclipse.org/uml2/2.0.0/UML"; (not sure if it is always just one). The content of this EAnnotation should be an EPackage. In that EPackage, you locate the EClasses that represent your stereotypes.

Please make sure that you load all files (profile, instance models, metamodels, transformation) using a single resource set. This is important because for a consistent loading of all models you need a single package registry (which is provided by the resource set). It is not really important whether you use a HenshinResourceSet or a normal ResourceSetImpl (the former just contains some convenience methods and smarter default values).

Hope that works.

Cheers,
Christian

And again, thank you very much for your support!
Jens
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



Back to the top