Custom renderer for ServiceTask, removing only the gear

I would like to draw ServiceTasks slightly differently from the standard: the gear would be replaced by a PNG icon.

Starting from the example (GitHub - bpmn-io/bpmn-js-example-custom-rendering: An example of creating custom rendering for bpmn-js) I have developed a custom renderer and a custom palette, all is working fine, except that the gear is still drawn because I call bpmnRenderer.drawShape in order to reuse the standard representation (indeed I would like to keep the label and any other standard drawings). Looking at the renderer code, I see that the gear drawing is hard coded for the ServiceTask type.

What I would like to do is to call the ‘basic’ Task drawShape instead of the ServiceTask one, but I can’t find a way to do that (in my drawShape function, I have tried to clone the element, override its type property to 'bpmn:Task' instead of 'bpmn:ServiceTask', before calling bpmnRenderer.drawShape, but it causes a crash).

FYI - It’s important for me to keep the bpmn:ServiceTask type because the workflow should then be executed by Camunda, and the an external service task would have to be invoked.

Would you please have any suggestion to do that?
Many thanks!

It looks like I have found a workaround:

      element.type = 'bpmn:Task'
      const shape = this.bpmnRenderer.drawShape(parentNode, element);
      element.type = 'bpmn:ServiceTask'

But I find this ugly. So if you have anything better, please let me know :slight_smile:
And if you think it’s a valid approach, please let me know as well!