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
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?