# Label complete api

**URL:** <https://forum.bpmn.io/t/label-complete-api/5621>\
**Category:** Modeler\
**Created:** [December 23, 2020, 5:54pm UTC](https://forum.bpmn.io/t/label-complete-api/5621 "2020-12-23T17:54:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MintButler](https://forum.bpmn.io/user_avatar/forum.bpmn.io/mintbutler/32/2485_2.png) [@MintButler](https://forum.bpmn.io/u/MintButler)\
**Post date:** [December 23, 2020, 5:54pm UTC](https://forum.bpmn.io/t/label-complete-api/5621/1 "2020-12-23T17:54:40Z")

</div>

Hi, i need create Task with certain default label and without possible to edit it immediately (there shouldn’t be input field after task created). So i do this

```auto
import BpmnModeler from 'bpmn-js/dist/bpmn-modeler.production.min';
....
const modeler = new BpmnModeler({ container: '.bpmn-editor' });
modeler.importXML(bpmnString);

const eventBus = modeler.get('eventBus');
eventBus.on('commandStack.shape.create.postExecute', (event) => {
  if (event.context.shape.type === 'bpmn:Task') {
    const modeling = modeler.get('modeling');
    modeling.updateProperties(event.context.shape, {
      name: 'New name',
    });
    const directEditing = modeler.get('directEditing');
    console.log(directEditing.isActive()); // always false
    directEditing.complete();
  }
});

```

This is not working. What wrong with my code?

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [January 4, 2021, 10:00am UTC](https://forum.bpmn.io/t/label-complete-api/5621/2 "2021-01-04T10:00:28Z")

</div>

Welcome to our forum!

Direct editing activation is controlled via the [`LabelEditingProvider`](https://github.com/bpmn-io/bpmn-js/blob/develop/lib/features/label-editing/LabelEditingProvider.js).

I suggest you to dig into that component to understand how editing is triggered in the first place and ensure that that does not happen. Completing direct editing right away reads like a big hack for me if you can prevent direct editing in the first place.

For further support, please share a [CodeSandbox](https://codesandbox.io/s/bpmn-js-sandbox-3zkw0) that clearly illustrates your usage.

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [July 22, 2025, 3:35pm UTC](https://forum.bpmn.io/t/label-complete-api/5621/3 "2025-07-22T15:35:04Z")

</div>

Closed on July 22, 2025, 3:35pm UTC


