Skip to main content

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 12:55 Go to next message
Tarcísio Couto is currently offline Tarcísio CoutoFriend
Messages: 29
Registered: May 2013
Junior Member
Hello guys,

I have an element NFRSoftgoal with the following attributes:


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 13:15 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member

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.

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

Current Time: Sun Jul 25 12:41:07 GMT 2021

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

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

Back to the top