ThitGaRang / emf-profiles

Automatically exported from code.google.com/p/emf-profiles
0 stars 0 forks source link

Support stereotype applicability constraints in OCL #41

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Support the specification of OCL constraints to limit the applicability of 
stereotypes. For instance, let's say you want to specify that a stereotype can 
only applied to instances of EClass if the instance of EClass is abstract.

This should be quite easy to implement. Basically, we would have to 

1. add an attribute to Extension in the profile metamodel [1] that may hold an 
OCL constraint; the OCL constraint should be specified in the context of the 
extended metaclass
2. extend isApplicable(EObject, Extension, EList<Extension>) [2] in 
StereotypeImpl by taking the evaluation of the respective extension's OCL 
constraint on the specified EObject into account

[1] 
https://code.google.com/a/eclipselabs.org/p/emf-profiles/source/browse/org.model
versioning.emfprofile/model/emfprofiles.ecore
[2] 
https://code.google.com/a/eclipselabs.org/p/emf-profiles/source/browse/org.model
versioning.emfprofile/src/org/modelversioning/emfprofile/impl/StereotypeImpl.jav
a#186

Original issue reported on code.google.com by p.langer on 22 Nov 2013 at 10:50