I found quite a simple way to make sure a "task-end" event does not get fired
when cancelling a task instance. I remove the event, cancel the task instance, and then
add the event back.
Simply use code similair to the following:
taskInstance.setSignalling(false);
| Task task = taskInstance.getTask();
| Event endTaskEvent = task.getEvent(Event.EVENTTYPE_TASK_END);
| if (endTaskEvent != null) {
| task.removeEvent(endTaskEvent);
| }
| taskInstance.cancel();
| if (endTaskEvent != null) {
| task.addEvent(endTaskEvent);
| }
It seems to work fine for me. Can anyone see anything wrong with doing it this way? It
doesn't seem to update the database with new events or actions or anything, as you are
adding back the same event object.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4142304#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...