Replies: 1 comment
-
This is really nothing special, it just keeps an integer for each element type (e.g. an EClass) to provide a counter, so that unique names and IDs can be generated by creating id+counter, such as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
this is not an important question, so don't take it to seriously, but it took me now more than an hour trying to understand the method
GModelUtil.generateId
- and finally I give up.The
GModelUtil
class yells at me: You never studied informatics? Than you're too stupid for this code!I see no sense in the param ID of the method
For my understanding the method simply counts the number of model classes of 'eClass' in the modelState and increases the number by 1.
The method is used in the workflow example to generate a default label for new elements added to the model. The Id reflects the
elementTypeID
which is part of the classCreateNodeOperationHandler
. The elemenetTypeID (for my understanding) defines the type of the Node.You could expect that the ElementTypeID is used to generate separate counters for each type. But only the eClass seems to be relevant.

I am now fine with this. But if someone could explain to me how the method works, then I'm happy. It's never to late to learn. And I promise to make a pull request with the corresponding javadoc comment in the method header ;-)
Beta Was this translation helpful? Give feedback.
All reactions