-
1. Re: Task completion without outcome?
heiko.braun May 6, 2009 6:14 AM (in response to heiko.braun)I would expect TaskService.complete(taskId) to do one of the following:
a) single out transition: use it
b) multiple out transitions: use default if given
c) multiple out transitions: throw error if no default given -
2. Re: Task completion without outcome?
tom.baeyens May 6, 2009 7:20 AM (in response to heiko.braun)outcome is the second optional parameter in the complete method.
tasks bind the outcome to an outgoing transition. if no outcome is given, then the task should only have 1 outgoing transition.
if a task has multiple outgoing transition, the outcome must be specified and match the transition name.
providing no value for outcome (or null) works if there is a single outgoing transition or if there is a transition without a name.
does this answer the question? -
3. Re: Task completion without outcome?
tom.baeyens May 6, 2009 7:22 AM (in response to heiko.braun)i realize there must be an extra method to get the potential outcomes for a task dynamically.
https://jira.jboss.org/jira/browse/JBPM-2220 -
4. Re: Task completion without outcome?
heiko.braun May 6, 2009 7:30 AM (in response to heiko.braun)
providing no value for outcome (or null) works if there is a single outgoing transition or if there is a transition without a name.
No, it doesn't. It leads to the error above. Hence my question. -
5. Re: Task completion without outcome?
heiko.braun May 6, 2009 7:33 AM (in response to heiko.braun)
i realize there must be an extra method to get the potential outcomes for a task dynamically.
IMO it doesn't require an additional method in TaskService. Instead it can be a property of a Task. I.e.Set<String> Task.getOutcome()
-
6. Re: Task completion without outcome?
tom.baeyens May 6, 2009 8:02 AM (in response to heiko.braun)ok. i see the point.
so we both think that complete(null) should take the single outgoing transition if there is one, even if that transition has a name.
but the implementation doesn't do that.
right ?
i'll create a jira for it -
8. Re: Task completion without outcome?
kukeltje May 6, 2009 8:54 AM (in response to heiko.braun)and why not have it take the default transition if there is more then one? complete() and complete(null) would be the same then... not completely illogical
-
9. Re: Task completion without outcome?
tom.baeyens May 6, 2009 11:19 AM (in response to heiko.braun)because the default transition doesn't have to be the one without a name. complete(null) should take the unnamed transition in case there are many outgoing transitions.
-
10. Re: Task completion without outcome?
heiko.braun May 6, 2009 2:48 PM (in response to heiko.braun)this is related to my other question "should transition names be enforced?". If they would be the discussion would be different. In that case complete(null) would raise an exception. IMO we introduce too much "magic code" that requires knowledge about the actual implementation.
-
11. Re: Task completion without outcome?
kukeltje May 6, 2009 5:00 PM (in response to heiko.braun)I agree. Just enforcing names makes everything more explicit.
- complete() takes the default transition whatever that may be. Magic code again or a attribute called 'default' with a value of 'true' and make it explicit.
- complete(null) throws an exception or also takes the default transition
I'm not in favour of doing things like take the transition without a name if the parameter passed to the complete method is null (what if there are multiple with no name?) -
12. Re: Task completion without outcome?
camunda May 7, 2009 2:21 PM (in response to heiko.braun)Making the default transition be specified by an attribute would be good I think!
Force transition names would be a good option I think.
But what bothers me is migration: A lot of people don't have transition names today nor do they tag the default transition. How can they easily migrate?
But I agree: Enforce transition names and enforce "marking" the default transition would be both good in my eyes.