Throw error when updateProperties

i want to change element’s name after element create.
this is my code and the error message:


Hi @himyyy,

you are trying to execute a command during the execute phase of another command. This is not possible and therefore causes this error.

Please use the CommandInterceptor. Here you can find an example which should solve your use case easily:

class DefaultElementName extends CommandInterceptor {
  constructor(eventBus, modeling) {

    this.postExecute("shape.create", ({ context }) => {
      const { shape } = context;

      const { id } = shape;

      modeling.updateLabel(shape, id);

thanks a lot, it works