Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to use the Container Configuration in an ElementTypeSetConfiguration?
How to use the Container Configuration in an ElementTypeSetConfiguration? [message #1736521] Thu, 30 June 2016 07:26 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 169
Registered: January 2013
Location: Sweden
Senior Member
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 09:21 Go to previous messageGo to next message
Florian Noyrit is currently offline Florian NoyritFriend
Messages: 16
Registered: February 2016
Location: Grenoble, France
Junior Member
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 #1736559 is a reply to message #1736521] Thu, 30 June 2016 10:33 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 169
Registered: January 2013
Location: Sweden
Senior Member
I figured out a way to do it.

Instead of using Specialization Type Configurations I use Type Configurations which can have rules set up. By having a combination of And Rule Configuration, Invariant Container Rule Configuration and Hierarchy Permission I got it to work

    <ruleConfiguration xsi:type="rulebased:AndRuleConfiguration">
      <composedRules xsi:type="invariantcontainerrule:InvariantContainerRuleConfiguration">
        <permissions containerType="<my.container.type>" permitted="true"/>
      </composedRules>
    </ruleConfiguration>
Re: How to use the Container Configuration in an ElementTypeSetConfiguration? [message #1736921 is a reply to message #1736540] Mon, 04 July 2016 11:43 Go to previous message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 169
Registered: January 2013
Location: Sweden
Senior Member
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:21
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

Previous Topic:Is it possible to develop a XMI to Java Code converter plugin?
Next Topic:Listner for the ViewPoint configurations
Goto Forum:
  


Current Time: Sat Jul 04 22:57:02 GMT 2020

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

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

Back to the top