AnsweredAssumed Answered

Distinguish deleted and finished processes in end listener

Question asked by msvelev on Dec 23, 2014
Latest reply on Jan 7, 2015 by msvelev
Hello community,

I'm currently trying to implement a logic that understands if a process has been deleted from the runtime api or it has finished on its own.
I'll be using this in an ExecutionListener which is triggered when a process ends.
My current solution is to check:
"End".equals(context.getCurrentActivityName());

And it works just fine, but I want this to be a generic method that can be applied to all activiti processes and not only those whose end event is named "End".

I've noticed that when the process was deleted I get null from
context.getCurrentActivityName()

If that's always the case when a process is deleted then it would be a perfect solution to just check if it is null.
Is this the expected behavior and if not can you propose another solution?

Thanks & best regards,
Mincho

Outcomes