Is there any way I can find out from DelegateExecution object available at the time of event listeners getting fired, whether a task was interrupted/ cancelled
For example when a task is cancelled upon an interrupting timer firing
Hi @asarvaiya
You could use a TaskLister and listen to DELETE Event of Task.
If a Task is completed by a user it will only fire the COMPLETE Event but if it is interrupted, for example by a timer event, it will fire the DELETE Event.
Best regards,
Markus
I am using Execution Listener. Is there any way to find out if the event was a DELETE from the DelegateExecution object which is passed as argument to the notify method of the ExecutionListener.
Hi
you could try this:
((ExecutionImpl)delegateExecution).getDeleteReason() != null
But I am not 100% sure.
You should give it a try.
Best regards,
Markus
This does not seem to work since the execution is not instanceof ExecutionImpl
Is there any other way to detect the task cancellations
Hi Yana
I am using execution listener and my question was how to detect interruptions/cancellation of a task when in the notify method of execution listener.
Hi @asarvaiya
Then try to cast it to org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl. See attached type hierarchy. DelegateExecution has to be type of this class.
It also supports a getDeleteReason method.
Actually I found that DelegateExecution has a function called isCanceled()
This will directly indicate if the task was cancelled