Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Iterator id(Iterator id)
Iterator id [message #1138971] Tue, 15 October 2013 08:55 Go to next message
Tarcísio Couto is currently offline Tarcísio Couto
Messages: 29
Registered: May 2013
Junior Member
Hello guys,

I have an element NFRSoftgoal with the following attributes:

Id
Name
NFRSoftgoalPriority

I would like to every time that an user insert an element, the Id and NFRSoftgoalPriority changes automaticaly, example:

The first one was inserted, than the Id can be 1.. the second, the id can be 2, and so on..

I can do that, but when I close and open the model again and I insert another NFRSoftgoal, it starts to count from 0 and not from the last id..

Could someone help me?

Thank you.
Re: Iterator id [message #1138994 is a reply to message #1138971] Tue, 15 October 2013 09:15 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

did you try to use feature seq initializer in your mapping model and define ocl that looks like the following for assigning to the id attribute on creation:

NFRSoftgoal.allInstances().id->max() + 1

This should do the trick.

Ralph
Previous Topic:How is saving working in GMF?
Next Topic:type of created diagram in GMF run-time
Goto Forum:
  


Current Time: Tue Jul 22 09:42:55 EDT 2014

Powered by FUDForum. Page generated in 0.02306 seconds