cancel
Showing results for 
Search instead for 
Did you mean: 

How to listen on boundary event firing / activity cancelled

rgielen
Champ in-the-making
Champ in-the-making
Hi,

we have a requirement to use boundary timer events for some user tasks along with notifying an outside system in case a user task gets cancelled by the boundary event.

First I was thinking that a COMPLETE event listener on the user task might do the trick, although I would have been worried about the semantics then. As expected, COMPLETE does not get fired. On the other hand, there seems to be nothing like an CANCEL event to listen on.

I looked further and came across BoundaryEventActivityBehavior, which, if listener attachments were supported, would solve my problem as well. But afaics, no such support is available at least in Activiti 5.9.

Am I missing something out? Is there a way I haven't found yet to accomplish my requirement?

On the other hand, wouldn't support for a TaskListener.CANCEL event semantic be a useful framework addition, as well as well for support some boundary events listener infrastructure? If there is such interest, I might be able to work on a patch to provide such functionality.

TIA,
- René
7 REPLIES 7

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Why not just have a service task after the boundary timer?

rgielen
Champ in-the-making
Champ in-the-making
That would of course technically work.

Nevertheless, the requirement for notification is a purely technical crosscutting concern on all boundary task definitions that will be executed within the outer system with Activiti embedded. The processes itself are true business domain processes, editable by the user (knowing nothing about technical foo, but about his business). Both cluttering process definitions with technically induced service tasks and requiring the user to not forget this seem not to be a feasible options in the end, I guess…

Thanks,
- René

meyerd
Champ on-the-rise
Champ on-the-rise
Hi rgielen,

note that you can also add Execution listeners to sequence flows. That might also be an option here.

sebastian_s
Champ in-the-making
Champ in-the-making
Today I faced exactly the same problem. The work-around proposed by Ronald is unfortunately not useful for me since adding additional tasks to the proess definition or changing the sequence flow in any way in general is not an option for me.

Furthermore I cannot use Daniel's work-around since I don't want to add listeners to the sequence flows since this makes the process definitions hard to maintain when process topology has to be changed due to a business requirement.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
You can augment the BPMNParser and deploy time add them… Search the forum for hints/examples. I do not have these at hand

rgielen
Champ in-the-making
Champ in-the-making
Hi rgielen,

note that you can also add Execution listeners to sequence flows. That might also be an option here.

Hi Daniel,

thanks for your suggestion. To get around our current itches, we indeed implemented an execution listener for the timerActivity given in the parseBoundaryTimerEventDefinition hook of our parse listener. Thus we could emulate a user task interrupted / cancelled event behavior.

Nevertheless, IMO it would much cleaner to complete lifecycle event support for tasks, including a CANCEL event. Anyone with me on that topic? Smiley Happy

Regards,
René

rgielen
Champ in-the-making
Champ in-the-making
You can augment the BPMNParser and deploy time add them… Search the forum for hints/examples. I do not have these at hand

For our use case we are using the ParseListener infrastructure anyway. That's where we are injecting our cross cutting behavior.

Regards,
René