Using DelegateExecution available in a start-execution-listener, how to find if the task type is external or service

Using DelegateExecution available in a start-execution-listener, how to find if the task type is external or service. Looking for a java code of this.

DelegateExecution#getBpmnModelElementInstance returns the currently executed activity as a BPMN model instance object. You can use that to access any XML attributes as shown in the examples here: https://docs.camunda.org/manual/7.8/user-guide/model-api/bpmn-model-api/read-a-model/

Cheers,
Thorben