Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF CP] NewModelElementWizard for non root elements
[EMF CP] NewModelElementWizard for non root elements [message #781088] Fri, 20 January 2012 08:42 Go to next message
Michael Missing name is currently offline Michael Missing name
Messages: 1
Registered: January 2012
Junior Member
Hi,

I have the following situation:
Object A (which is not the root element) has more than 5 possible containment references. One of this containments, call it Object B, has a multiplicity of one. If I make a right click on A, the context menu offers me the option "New Model Element" and opens the NewModelElementWizard after a click on it.
If I select object B in the wizard for adding to A and press the OK Button, nothing happens. B is not added to A.
After a little debugging I found the following if-statement in the NewModelElementWizard:
if (possibleContainingReference != null && possibleContainingReference.isMany())

This case only happens, if the selected object (in my case object A) is not the root object (ECPProject). But the possibleContainingReference.isMany() constraint in the statement avoids the addition of B to A!

My question now, is this the intended behaviour or a bug?
It seems that my described case isn't handled by ECP.

Best regards,

Michael
Re: [EMF CP] NewModelElementWizard for non root elements [message #782920 is a reply to message #781088] Tue, 24 January 2012 13:18 Go to previous message
Jonas Helming is currently offline Jonas Helming
Messages: 412
Registered: July 2009
Senior Member
Hi Michael,
I wonder which version you are using? You are right, that this if
statement is incorrect. However the NewWizard should only be shown for
the root element. In the past we have also shown it for elements which
have more then 5 containments. The problem was that the wizard can only
select the class to create, not the reference to add the new element to.
In other words, if you had an element with more then 5 containment
features and to of them reference the same type, you could not select
which feature to use. In the latest Milestones, the wizard should only
be active on the root level.
Does this help you?
Best Regards
Jonas

Am 20.01.2012 14:42, schrieb Michael Mising name:
> Hi,
>
> I have the following situation:
> Object A (which is not the root element) has more than 5 possible
> containment references. One of this containments, call it Object B, has
> a multiplicity of one. If I make a right click on A, the context menu
> offers me the option "New Model Element" and opens the
> NewModelElementWizard after a click on it.
> If I select object B in the wizard for adding to A and press the OK
> Button, nothing happens. B is not added to A.
> After a little debugging I found the following if-statement in the
> NewModelElementWizard:
> if (possibleContainingReference != null &&
> possibleContainingReference.isMany())
> This case only happens, if the selected object (in my case object A) is
> not the root object (ECPProject). But the
> possibleContainingReference.isMany() constraint in the statement avoids
> the addition of B to A!
>
> My question now, is this the intended behaviour or a bug?
> It seems that my described case isn't handled by ECP.
>
> Best regards,
>
> Michael
Previous Topic:validation without using editor plugin
Next Topic:How to specify enum as attributes using Rational Software Modeler
Goto Forum:
  


Current Time: Fri Aug 01 12:18:07 EDT 2014

Powered by FUDForum. Page generated in 0.01684 seconds