End ExecutionListener and delete process

Hello there,

I want to cancel processes, but it is difficult with ExecutionListener with the Event Type of end

Every time I get a NullPointerException because of my GetUserProfile class, because there is no possible getUserId because of the abort.

        String userId = execution.getProcessEngineServices()
                .getIdentityService()
                .getCurrentAuthentication()
                .getUserId();

I don’t have the Enterprise version, so maybe someone knows a way without SkipCustomListeners?

If anyone has the same problem:

I have solved it for now so that the user data (first and last name) are queried in a start-Execution Listener at the next task …
Accompanying this I have renamend GetUserProfile to GetLastUserProfile.

Not the best implementation, but now you can deleting the tasks with a end-Execution Listener.