Throw error when updateProperties

i want to change element’s name after element create.
this is my code and the error message:
B913E445-EF71-46ff-91ED-F3E20B37457D

1602822798

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) {
    super(eventBus);

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

      const { id } = shape;

      modeling.updateLabel(shape, id);
    });
  }
}

thanks a lot, it works