getProcessEngineServices() in External Task

Hi,

I have used the following way to get all users from a DMN having group A with key ‘parallel’.

List parallelUsers = execution.getProcessEngineServices().getIdentityService().createUserQuery()
.memberOfGroup(parallel).list();

How can I update the same so that it can be used in an external application. When I used the same statement as below, an error occurred.

Kindly help me to resolve the same.
Thank you,
Ashwathi