Iterator id [message #1138971] |
Tue, 15 October 2013 08:55  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03227 seconds