Discard Element when change Task from a type to another


I tried to change a Task from User to Manual from the diagram. It threw an exception, because it changed the task type, but all customizations and extensions remained. Is there a way to totally discard the task and create a new one with the selected task type?

Thank you


What’s the context? How did you try to change the type of the task? Through interacting with the modeler or through the API? Can you share any code/screenshot?