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 (!! { = 'bpmn:Task'; delete; var newElementData = { type: 'bpmn:Task', id: } const replace = bpmComponent.modeler.get('bpmnReplace'); = replace.replaceElement(, 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