Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354467 - "Create undefined" in create context menu
Summary: "Create undefined" in create context menu
Status: RESOLVED FIXED
Alias: None
Product: GMF-Tooling
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-11 05:18 EDT by Ralph Gerbig CLA
Modified: 2014-07-01 08:30 EDT (History)
3 users (show)

See Also:


Attachments
Screenshot (3.91 KB, image/png)
2011-08-11 05:19 EDT, Ralph Gerbig CLA
no flags Details
Patch (1.14 KB, patch)
2011-08-20 12:58 EDT, Ralph Gerbig CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Gerbig CLA 2011-08-11 05:18:46 EDT
Build Identifier: 20110615-0604

I use the create connection pop ups to create a connection. The context menu should show "Create EStructuralFeatureName" and "Create EStructuralFeatureName" which are both targets features of the link mappings. But it shows "Create Undefined". I attached a screenshot demonstrating the problem. Where is the context menu build up so that I can fix this bug? If I have the right plugin/class I certainly could fix this bug.

Reproducible: Always
Comment 1 Ralph Gerbig CLA 2011-08-11 05:19:19 EDT
Created attachment 201301 [details]
Screenshot
Comment 2 Mickael Istria CLA 2011-08-11 05:21:50 EDT
is the label correcly set in the domain model?
Comment 3 Ralph Gerbig CLA 2011-08-11 05:29:40 EDT
If you mean the feature name in the ecore file, it is correctly set. I cannot find a label property in the ecore and generator model.
Comment 4 Michael Golubev CLA 2011-08-11 17:31:28 EDT
The name of corresponding IElementType is shown here, you might check and correct it in the element type extension of the plugin.xml. 

You shoul dsee the same Undefined's in the popap bar for the container that may contain the end nodes of this link. 

I am closing the bug as WoksForMe, although its not clear why the element type was not choosen correctly (as it normally should be at least for nodes, while may experience legitimate troubles with feature links).
Comment 5 Ralph Gerbig CLA 2011-08-12 02:58:42 EDT
I think this is related to tooling either the transformation to the genmodel or the template extensions.xpt whith this definition.

# Providers
«EXPAND internal_i18n FOREACH getAllTypedElements().elementType»
«ENDDEFINE»

«DEFINE internal_i18n FOR gmfgen::ElementType-»
«IF null <> displayName and not definedExternally»metatype.name.«diagramElement.getUniqueIdentifier()»=«displayName»«ENDIF»
«ENDDEFINE»

I think we should certainly fix to have undefined as the default value in the genmodel. This would allow users to still override the display name. This would fix the issue to have undefined as default value. I can try to propose a patch if others think it makes sense.
Comment 6 Ralph Gerbig CLA 2011-08-12 02:59:10 EDT
Think it is a bug related to tooling.
Comment 7 Michael Golubev CLA 2011-08-12 04:34:27 EDT
This property is already editable in the property sheet for gmfgen, so user already able to override that in UI
Comment 8 Ralph Gerbig CLA 2011-08-12 04:39:52 EDT
Thats true. But I think that having Undefined in there is the bug.
Comment 9 Ralph Gerbig CLA 2011-08-20 12:58:49 EDT
Created attachment 201857 [details]
Patch

Hi,

I created this patch based on a custom template that worked for me. However, I am not able to get this debugged in my target workbench.

Ralph
Comment 10 Mickael Istria CLA 2011-10-28 09:12:34 EDT
Committed patch, works locally, waiting for the IC test to remain blue.
Comment 11 Benjamin S. CLA 2014-06-30 22:40:58 EDT
Not resolved any more!

Problem patch is commented out.
Patch is working, but I couldn't see a reason for the comment.
Comment 12 Mickael Istria CLA 2014-07-01 03:11:00 EDT
(In reply to Benjamin S. from comment #11)
> Patch is working, but I couldn't see a reason for the comment.

Try "git blame" on this file, it will show you as part of which commit this got commanded and hopefully the commit message will give you the reason.
Comment 13 Benjamin S. CLA 2014-07-01 06:01:16 EDT
I traced the commits back...
First commit was 
0242d4345f0391d77a11abd3e3db0d3d8fa4011d to Map2Gen.qvto
5a9aeaf4527a9557ec6f8e927f2a090b91089e88 moved helper to Map2GenUtil.qvto
Refactor commits:
fa2e9f4fe44fb57aeaa17bd7ddb47014db6a5b33 deleting helper methods in Map2GenUtil.qvto
d831103ebfc6ac30d04519cf6d43dddc56090c49 adding methods again into Mappings.qvto

Commit message was:
Rewrite the mapping of CompartmentMapping, previous usage of Tuples throws IllegalArgumentException under OCL 4.0.0

The commented sections has nothing to do with this commit message.
In my opinion just a copy-paste mistake, however this happens.

Just curious that nobody spotted it the last 2 years...
Comment 14 Michael Golubev CLA 2014-07-01 08:30:31 EDT
I will take a look, also it is difficult for me to relate the commit you found with this problem. 

For now I would like to repeat the workaround: 
>> The name of corresponding IElementType is shown here, you might check and 
>> correct it in the element type extension of the plugin.xml.