[
https://jira.jboss.org/jira/browse/JBPM-2492?page=com.atlassian.jira.plug...
]
Tom Baeyens commented on JBPM-2492:
-----------------------------------
Here's how we want to change the outcomes handling:
The strategy that we propose is that we couple the outcomes to the outgoing transition
names directly. So transitions without a name will match with the outcome value of null.
If no outcome will be specified with completing a task, null will be used as outcome and
hence it will bind to the first transition without a name. The getOutcomes method will
return null values for transitions without name. In the jBPM web console, the null values
from the getOutcomes will be mapped to a default transition button name like
"Completed".
a) suppose task has one outgoing transition without a name
then:
- getOutcomes() returns a collection that includes one null value
- taskService.completeTask(taskId) will take that outgoing transition
- taskService.completeTask(taskId, null) will take that outgoing transition
- taskService.completeTask(taskId, "anyvalue") will result in an exception
b) suppose task has one outgoing transition with name 'Accept'
then:
- getOutcomes() returns a collection that includes one 'Accept' value
- taskService.completeTask(taskId) will result in an exception (as there is no transition
without a name)
- taskService.completeTask(taskId, null) will will result in an exception (as there is no
transition without a name)
- taskService.completeTask(taskId, "anyvalue") will result in an exception
- taskService.completeTask(taskId, "Accept") will take the 'Accept'
transition
c) suppose a task has multiple outgoing transitions. one without a name and one with name
'Reject'
- getOutcomes() returns a collection that includes a null value and 'Accept'
- taskService.completeTask(taskId) will take the transition without a name
- taskService.completeTask(taskId, null) will take the transition without a name
- taskService.completeTask(taskId, "anyvalue") will result in an exception
- taskService.completeTask(taskId, "Reject") will take the 'Reject'
transition
d) suppose a task has multiple outgoing transitions. one called 'Accept', one
called 'Reject' and no transition without a name
- getOutcomes() returns a collection that includes 'Accept' and 'Reject'
- taskService.completeTask(taskId) will result in an exception
- taskService.completeTask(taskId, null) will result in an exception
- taskService.completeTask(taskId, "anyvalue") will result in an exception
- taskService.completeTask(taskId, "Accept") will take the 'Accept'
transition
- taskService.completeTask(taskId, "Reject") will take the 'Reject'
transition
GetOutcomes returns an additional Outcome than what is already
specified than the
----------------------------------------------------------------------------------
Key: JBPM-2492
URL:
https://jira.jboss.org/jira/browse/JBPM-2492
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: jBPM 4.0.CR1
Reporter: Shekhar Vemuri
Assignee: Tom Baeyens
Fix For: jBPM 4.2
Description is below:
It was decided in a discussion in the forum(referenced in this issue) that we would not
add the additional transition to the list of transitions that are available as part of
completing a task.
Problem:
Is there a particular reason for why GetOutComes does this?
Code:
Set<String> outcomes = new HashSet<String>();
outcomes.add(Task.STATE_COMPLETED);
.. logic to add other transitions specified in the activity.
When the TaskService.getOutComes(long taskDbId) is called with a task id it returns
completed as an entry in the list of Transitions that will eventually be shown to the
user.
But this particular transition is not even being modeled in the process_definition.
There are other places in the code, where in if a transition/outcome name is not
specified then the transition is assumed to the 'completed' and special handling
is done,
Code:
if (Task.STATE_COMPLETED.equals(signalName)) {
if (outgoingTransitions.size()==1) {
transition = outgoingTransitions.get(0);
} else {
transition = activity.getDefaultOutgoingTransition();
}
}
The above snippet is from TaskActivity.
What is the reasoning behind adding this to the transitions that can be taken out of a
Task node?
_________________
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira