token.getAvailableTransitions() -- need equivalent that returns ordered list.
-----------------------------------------------------------------------------
Key: JBPM-1067
URL:
http://jira.jboss.com/jira/browse/JBPM-1067
Project: JBoss jBPM
Issue Type: Feature Request
Components: Core Engine
Affects Versions: jBPM jPDL 3.2.2
Environment: All OS
Reporter: s b
Assigned To: Tom Baeyens
This feature request is requesting:
1) API which adds a version of token.getAvailableTransitions() which returns an ordered
List that preserves the order of the transitions as defined in the processdefinition.xml
file for the node, rather than returning an unordered Set object.
2) Also request that TaskInstance.getAvailableTransitions() be modified to return an
ordered list rather than a randomly ordered list by calling the new method.
For example:
------------------------
public class TaskInstance extends VariableContainer implements Assignable {
...
public List getAvailableTransitions() {
List transitions = null;
if ( (! isLast())
&& (token!=null)
) {
transitions = token.getAvailableTransitionsList(); // using new method
}
return transitions;
}
...
----------------------------------------
Problem:
node.getLeavingTransitions() appears to preserve the order, but the order is apparently
lost when the transistions are added to the Set which is returned by
token.getAvailableTransitions().
Preserving the ordering is highly useful when implementing a minimal data-driven interface
which presents the user with the transitions to choose from. The designer could exercise
some control over the presentation of the choices if only the order were preserved as
defined in the processdefinition.xml file.
Solution:
Make a clone of "token.getAvailableTransitions()", name it
"token.getAvailableTransitionsList()", and add the filtered transitions to a
List instead of to a Collection, and return the list. Make sure the order is preserved
the same as the transitions were defined in the "processdefinition.xml" file.
Modify "TaskInstance.getAvailableTransitions()" to call
token.getAvailableTransitionsList().
Summary:
Although workarounds exist with existing code, it would be very helpful (and consistent I
think) to provide an API that retrieves a list of the "available transitions"
that is ordered as defined in the processdefinition.xml file instead of an unordered Set
or List as is currently available.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira