[Design of JBoss jBPM] - Re: Cancelling a task fires task-end event
by jbarrez
Ronald,
If you are using this construction:
| if (this.isCancelled) {
| task.fireEvent(Event.EVENTTYPE_TASK_CANCEL, executionContext);
| } else {
| task.fireEvent(Event.EVENTTYPE_TASK_END, executionContext);
| }
|
Then you are missing the TASK_END event if the task is cancelled. People for who see 'finishing a task ' (ie. cancelling or completing) as the end of a task (which is conceptually also correct) and now simply use an event handler for the TASK_END event are obliged to use 2 event handlers now.
So it comes down to a matter of conceptual view:
- Ending a task == the task is finished (removed by cancelling or successfully completed)
- Ending a task == completing the task successfully, BUT cancelling means here that the task did not end but simply dissapeared for some reason.
I have implemented both use cases in the past, so this is not some academic example. What we need here is a solid and clear definition ...
anonymous wrote :
| Otoh, I've not heard people complaining about taskmanagement regarding the 'states' of task management do you guys? Questions were more about declaring vars, typing them, giving default values etc
|
That's true ... but I did have a use case in which the states of a task were THE most import thing: cancelled, suspended, ended, assigned but not taken, working on it, etc. all those states were possible for a task. So you can imagine I would have been very happy at that moment if I had some more options ... we had to juggle a bit with task variables to get it all done.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180733#4180733
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180733
16 years, 3 months
[Design of JBoss jBPM] - Re: Cancelling a task fires task-end event
by kukeltje
"jbarrez" wrote :
| It is a difficult topic :p
|
I tend to disagree, see below
"jbarrez" wrote :
| I have a use case in which having a cancel event would be great. In that use case is cancelling a task conceptually different from ending a task: ie. a cancelled task is a task which has not been ended (= finished correctly) by someone.
|
| But, Tom is right: for another customer the story could be different ...
|
If they are the same for this user, They will just use one or the other (most likely end() ). But for others, they can put any logic they want on 2 'event-handlers' so..
"jbarrez" wrote :
| Perhaps for jBPM4, something drastical should happen to cover this since it will never be good for everybody... perhaps working with inheritance for events, so that you could catch Task-end and Task-cancel but also Task-finished (parent of end and cancel) event that is a catch-all if it doens't matter ... ?
Could be, but that makes it more difficult to implement. You can get that functionality by declaring 2 event-handlers as mentioned above.... I would not make it overly complicate. But if kind of hierarchical events are introduced, that would be fine to. In that case we agree and is it less complex/difficult than we thought.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4180725#4180725
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180725
16 years, 3 months