Change type of element on directEditing Event

Hello ,
I want to replace a type of a Task ( from userTask to Task ) I have to do it on directEditing.Activate event . But the issue is the directEditing doesn’t not work anymore .

Code :

eventBus.on('directEditing.activate', function (event) { if (!!event.active) { event.active.element.type = 'bpmn:Task'; delete event.active.element.businessObject.extensionElements; var newElementData = { type: 'bpmn:Task', id: event.active.element.id } const replace = bpmComponent.modeler.get('bpmnReplace'); event.active.element = replace.replaceElement(event.active.element, newElementData);

Can you help me please ?
Thank you !
Amra ,

Can you explain why you want to do that?

When we rename the task shape , we want to change the type