CustomElements: Autogenerate ID


#1

Hello everybody,
What is the easiest way to automatically assign a random ID to custom-elements?


#2

Hi @A.N,

Changing properties is possible using the modeling API:

modeling.updateProperties(myElement, {
  id: 'foo' // or a generated random id
});

You can also have a look on how the BpmnFactory is setting random ids for new elements.


#3

Generate an ID on creation, i.e. using a running number.

Internally we use ids to come up with unique IDs that are slightly less likely to collision across documents.


closed #4