Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Emtpy Error when generating GMF tool, graph and map models
Emtpy Error when generating GMF tool, graph and map models [message #1042395] Tue, 16 April 2013 11:26 Go to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Hello folks

I seem to have stumbled upon an error[1] that I find strange and I was wondering if anyone could help me with it. I get it when I try to run "Eugenia->Generate GMF tool, graph and map models" on my ecore file after I have annoted it in an emf file.

The error seems to be related to PossibleValues section in my XText grammar below:
AttributeDefinition:
	'*' name = ValidName '(' type = AttributeType ')'
	(translations += Translation)*
	(internalProperties += InternalProperty
		| ( '-' externalProperties += ExternalProperty)
		| ( '+' possibleValues += PossibleValues ))*
;

PossibleValues:
	values += Type (',' values += Type)*
;


I know I can get rid of the error if I type
AttributeDefinition:
	'*' name = ValidName '(' type = AttributeType ')'
	(translations += Translation)*
	(internalProperties += InternalProperty)*
	( '-' externalProperties += ExternalProperty))*
	( '+' possibleValues += Type (',' possibleValues += Type)*)?
;


but then I end up with a "!unique attr String[*] possibleValues;" that I seem unable to turn into a @gmf.compartment and I am unable to make it a node in the GMF diagram. (So I can only edit the values from the property window and not able to add them directly in the diagram)

So I was wondering what limits me from having the PossibleValues property that only contains a list of Type (read as string in the .emf file) and is there a way to make it so that in the emf file I can "map" a "!unique attr String[*] possibleValues;" as a node?

Thanks for any help

Write you later / Mårten
Re: Emtpy Error when generating GMF tool, graph and map models [message #1042531 is a reply to message #1042395] Tue, 16 April 2013 14:40 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Mårten,

If memory serves, attribute-based compartments are not supported by Eugenia. I'll have a closer look at this when I get a chance and let you know if this is a limitation of Eugenia or something that's imposed by GMF. In any event, if it is possible to do this in GMF you could consider using a polishing transformation to automate the process.

Cheers,
Dimitris
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043279 is a reply to message #1042531] Wed, 17 April 2013 13:57 Go to previous messageGo to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Hi Dimitris

Thanks for the help, have a feeling I will have to add you and Claudio as references for my graduation paper with all the help you two give Smile

Have a bit paperwork that have fallen behind (its programming that is fun, not writing about it Smile) but I will hopefully be able to try some more at the end of the week. Had to google "polishing transformation", but always fun to learn new terms Smile.

I tried show them with labels instead, since I mostly just want them to be shown to the user in some way, but it didn't really work the way I wanted so was wondering what I was doing wrong.

I have two attribute-based compartments so I tried to do the following:
@gmf.node(label="name, type", label.pattern="{0} ({1}))
class myNode{
... node things ...
@gmf.label(label="possibleValues, defaultValues", label.(edit.)pattern="PossibleValues: {2}, DefaultValues: {3}")
  !unique attr String[*] possibleValues;
  !unique attr String[*] defaultValues;
}


but it wouldn't show the string for my label inside the node. If I had text in the default node label it worked fine I only seem to get values on the second label.
Am I misusing the labels?
I guess I can use the label for the entire node but just trying to separate the name and type from the other values.

Have a nice day
Mårten
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043358 is a reply to message #1043279] Wed, 17 April 2013 15:50 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Mårten,

The closest to valid Eugenia annotations would be the following:

---
@gmf.node(label="name, type", label.pattern="{0} ({1})")
class Node{
attr String name;
attr String type;
@gmf.label(label.pattern="PossibleValues: {0}")
!unique attr String[*] possibleValues;
@gmf.label(label.pattern="DefaultValues: {0}")
!unique attr String[*] defaultValues;
}
---

Would this be close to what you're after?

Cheers,
Dimitris
  • Attachment: node.png
    (Size: 6.16KB, Downloaded 201 times)
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043839 is a reply to message #1043358] Thu, 18 April 2013 07:19 Go to previous messageGo to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Hi Dimitris

Yes, that could look quite nice. Sadly when I type it like you do I still don't get the texts "PossibleValues" and "DefaultValues" for some reason[1].

Am I missing some update or something? I have downloaded the Eclipse Distribution from the epsilon homepage and I have Eugenia version 1.0.0.201211082326.
Or a longshot but I doubt it, it doesn't have anything to do with EGit? Get a warning because I don't have Git installed and the variable HOME declared when I start eclipse... but I doubt thats the problem just tossing things out there to try and cover more ground in one post Smile

Thanks for your time and patience

Write you later / Mårten
  • Attachment: node.png
    (Size: 17.70KB, Downloaded 212 times)
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043845 is a reply to message #1043839] Thu, 18 April 2013 07:26 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Mårten,

Could you please try to update to the latest interim version from [1] and see if this works?

Cheers,
Dimitris

[1] http://download.eclipse.org/epsilon/interim/
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043880 is a reply to message #1043845] Thu, 18 April 2013 08:14 Go to previous messageGo to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Hi Dimitris,

It doesn't seem to work from that update either. I seem to have a skill to make things not work for me that should work Smile.

But I tried to fiddle with the labels and I seem to have... strange behavior so I think I might have something wrong at my end. Some might be GMF related but I seem unable to use other label flags as well.
Things I noticed is:

  • The label.text="DefaultText" doesnt seem to do anything
  • The flag label.readOnly="true" only works for the node's label


Also found strange behavior when I try to modify the label in the diagram with delete and add (Might be GMF related):

  • Adding a new item requires that I first empty the label and write only the new value, if I write the new value in the middle of the others it will generate a new value combined of all the others among the first values, i.e try to add 15 to [3, 14] I get [3, 14, [3, 14, 15]]
  • Seem unable to delete values from the label in the diagram


Well, since the last parts probably is GMF related I still seem to have some issues with the gmf.label for EAttributes that shouldn't be there. Any idea what else I might take a look at?

Write you later / Mårten
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043890 is a reply to message #1043880] Thu, 18 April 2013 08:30 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

No worries - some of these annotations were added very recently to Eugenia so you may want to try the following bleeding-edge update site:

http://download.eclipse.org/epsilon/interim-very-new/ (there's no interim-very-very-new, I promise)

Cheers,
Dimitris
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043899 is a reply to message #1043890] Thu, 18 April 2013 08:37 Go to previous messageGo to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Ahh, now it works. Thanks for letting me use the very new stuff Smile

Best thing is I was joking with a friend that you where hiding features from me! Wink

Thanks again!
Have a nice day.

Write you later / Mårten
Re: Emtpy Error when generating GMF tool, graph and map models [message #1043903 is a reply to message #1043358] Thu, 18 April 2013 08:43 Go to previous messageGo to next message
Claudio Heeg is currently offline Claudio HeegFriend
Messages: 75
Registered: April 2013
Member
Dimitris Kolovos wrote on Wed, 17 April 2013 17:50
Hi Mårten,

The closest to valid Eugenia annotations would be the following:

---
@gmf.node(label="name, type", label.pattern="{0} ({1})")
class Node{
attr String name;
attr String type;
@gmf.label(label.pattern="PossibleValues: {0}")
!unique attr String[*] possibleValues;
@gmf.label(label.pattern="DefaultValues: {0}")
!unique attr String[*] defaultValues;
}
---

You know, looking at this, I was thinking.
Why not make it possible to reference directly within that label?
Let's say "type" was a reference to something defined in that model, that "type" has attributes "name" and "content". If "type.name" would be accessible directly from this label, that would in my opinion be a substantial help in designing.
What do you think, Dimitris, also about the difficulty of implementing this?
Re: Emtpy Error when generating GMF tool, graph and map models [message #1046337 is a reply to message #1043903] Sun, 21 April 2013 19:36 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Claudio,

It's hard to say off the top of my head but please feel free to file an enhancement request and I'll have a look at it when I get a chance.

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT.Epsilon

Cheers,
Dimitris
Re: Emtpy Error when generating GMF tool, graph and map models [message #1046696 is a reply to message #1046337] Mon, 22 April 2013 08:45 Go to previous messageGo to next message
Claudio Heeg is currently offline Claudio HeegFriend
Messages: 75
Registered: April 2013
Member
Dimitris Kolovos wrote on Sun, 21 April 2013 21:36
Hi Claudio,

It's hard to say off the top of my head but please feel free to file an enhancement request and I'll have a look at it when I get a chance.

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT.Epsilon

Cheers,
Dimitris


Thanks, here it is:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=406195
Re: Emtpy Error when generating GMF tool, graph and map models [message #1047406 is a reply to message #1046696] Tue, 23 April 2013 06:57 Go to previous messageGo to next message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Think I found an error in your new code related to the labels.
Because of a structural change in my XText grammar I had to change what I used in my label to a reference so I couldn't use it in my label anymore. (No such object objection)

So I tried to remove the label with @gmf.label(label.placement="none") but then I get a split error I didn't get with the older code.

Haven't used so much bug-report systems but should I try to add it in the link you posted before Dimitris?

Write you later / Mårten

[EDIT: Added the picture of the error message]

[Updated on: Tue, 23 April 2013 06:58]

Report message to a moderator

Re: Emtpy Error when generating GMF tool, graph and map models [message #1048540 is a reply to message #1047406] Wed, 24 April 2013 16:06 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Mårten,

Thanks for reporting this. Could you please file a new bug and attach a copy of your metamodel that we can use to reproduce this?

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT.Epsilon

Cheers,
Dimitris
Re: Emtpy Error when generating GMF tool, graph and map models [message #1048957 is a reply to message #1048540] Thu, 25 April 2013 06:55 Go to previous message
Mårten Carlzon is currently offline Mårten CarlzonFriend
Messages: 60
Registered: March 2013
Location: Sweden
Member

Hi Dimitris,

I have submitted a bug report here so have fun Smile

Write you later / Mårten
Previous Topic:Can you auto build eugenia and xtext
Next Topic:Generated Compile Errors
Goto Forum:
  


Current Time: Thu Mar 28 17:51:34 GMT 2024

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

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

Back to the top