How to use the Container Configuration in an ElementTypeSetConfiguration? [message #1736521] |
Thu, 30 June 2016 03:26  |
Eclipse User |
|
|
|
I'm trying to understand how to use the Container Configuration in an ElementTypeSetConfiguration?
The only property of a Container Configuration is EContainment Feature which I assume specified in which containment feature of the parent to store this elementType.
What I don't understand is how to restrict in which parent element types that can store the SpecializationType in the first place.
I have tree element types (A,B,C) based on UML Package, I'd like to express that only A can contain C. Can I do this with a Container Configuration (or something similar)?
Another odd thing is this. When I add one under a SpecializationType and open the dialog for its EContainment Feature property there is nothing to select. The Choices list isn't populated.
If I edit the configuration manually adding e.g. the choices are avialble the next time I add another Container Configuration.
<containerConfiguration
xmi:id="_tgfvMJgmEeSbPLBxcMMcNg">
<eContainmentFeatures
href="http://www.eclipse.org/uml2/5.0.0/UML#//Package/packagedElement"/>
</containerConfiguration>
|
|
|
Re: How to use the Container Configuration in an ElementTypeSetConfiguration? [message #1736540 is a reply to message #1736521] |
Thu, 30 June 2016 05:21   |
Eclipse User |
|
|
|
The Container Configuration is used to specify what ECore::EReference to use when multiple containing features are possible on the same metaclass.
For instance, when one want to create a UML::Behavior to a UML::State, there are three possible containing features: UML::State::entry, UML::State::exit, UML::State::doActivity. In this case, one could use the Container Configuration to force its ElementType to use one of this three. If not specified, the ElementType Framework will look for possible containing features and use the first it founds.
Therefore, this won't address your need. What you most probably need to do is to look at the rule-based elementtypes. You'll find usage of these in org.eclipse.papyrus.infra.types.tests\model\elementtypetest.elementtypesconfigurations.
Regarding the empty dialog, it is the expected behavior. Indeed, to populate this dialog, EMF seeks for all Ecore::EReference available in the ResourceSet. Therefore, if none is found (because the UML metamodel is not loaded) the dialog is empty. By defining the EReference manually in the elementtypeconfiguration model you indirectly added the UML metamodel to be loaded in the ResourceSet. Instead, you could just use the "Load Resource..." menu item available in the context menu when you right click in the editor.
HTH
|
|
|
|
Re: How to use the Container Configuration in an ElementTypeSetConfiguration? [message #1736921 is a reply to message #1736540] |
Mon, 04 July 2016 07:43  |
Eclipse User |
|
|
|
Thanks Florian,
When I try to reach the Papyrus/Migration Guide/Neon it can't be reached anymore. I believe that one had info on the new element types, eg. rule based element types.
What is the difference between a Type Configuration (which I assume is a rule based type) and a Specialization Type Configuration? From what I can see from the editing of the model the Type Configuration is similar to a Specialization Type Configuration but can have rules. Are there other differences?
Regards
Patrik
florian noyrit wrote on Thu, 30 June 2016 11:21The Container Configuration is used to specify what ECore::EReference to use when multiple containing features are possible on the same metaclass.
For instance, when one want to create a UML::Behavior to a UML::State, there are three possible containing features: UML::State::entry, UML::State::exit, UML::State::doActivity. In this case, one could use the Container Configuration to force its ElementType to use one of this three. If not specified, the ElementType Framework will look for possible containing features and use the first it founds.
Therefore, this won't address your need. What you most probably need to do is to look at the rule-based elementtypes. You'll find usage of these in org.eclipse.papyrus.infra.types.tests\model\elementtypetest.elementtypesconfigurations.
Regarding the empty dialog, it is the expected behavior. Indeed, to populate this dialog, EMF seeks for all Ecore::EReference available in the ResourceSet. Therefore, if none is found (because the UML metamodel is not loaded) the dialog is empty. By defining the EReference manually in the elementtypeconfiguration model you indirectly added the UML metamodel to be loaded in the ResourceSet. Instead, you could just use the "Load Resource..." menu item available in the context menu when you right click in the editor.
HTH
|
|
|
Powered by
FUDForum. Page generated in 0.24050 seconds