From c664c7e73c34ac815c77b492a6c62044b9dfdf64 Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Mon, 27 Oct 2008 18:38:04 +0000 Subject: [PATCH] SWF-923 Global Transitions don't fire listeners Applied fix suggested in jira. Global transitions now execute on the request context instead of directly on the transition. This allows the flow execution listener to hook in like a normal transition. --- .../springframework/webflow/engine/Flow.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java index 273d4d7e..a0127dcb 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java @@ -511,10 +511,11 @@ public class Flow extends AnnotatedObject implements FlowDefinition { /** * Start a new session for this flow in its start state. This boils down to the following: *
    - *
  1. Create (setup) all registered flow variables ({@link #addVariable(FlowVariable)}) in flow scope.
  2. Map - * provided input data into the flow. Typically data will be mapped into flow scope using the registered input - * mapper ({@link #setInputMapper(Mapper)}).
  3. Execute all registered start actions ( - * {@link #getStartActionList()}).
  4. Enter the configured start state ({@link #setStartState(State)})
  5. + *
  6. Create (setup) all registered flow variables ({@link #addVariable(FlowVariable)}) in flow scope.
  7. + *
  8. Map provided input data into the flow. Typically data will be mapped into flow scope using the registered + * input mapper ({@link #setInputMapper(Mapper)}).
  9. + *
  10. Execute all registered start actions ( {@link #getStartActionList()}).
  11. + *
  12. Enter the configured start state ({@link #setStartState(State)})
  13. *
* @param context the flow execution control context * @param input eligible input into the session @@ -555,7 +556,8 @@ public class Flow extends AnnotatedObject implements FlowDefinition { // try the flow level transition set for a match Transition transition = globalTransitionSet.getTransition(context); if (transition != null) { - return transition.execute(currentState, context); + return context.execute(transition); + // return transition.execute(currentState, context); } else { // no matching global transition => let the original exception // propagate @@ -568,9 +570,9 @@ public class Flow extends AnnotatedObject implements FlowDefinition { * Inform this flow definition that an execution session of itself has ended. As a result, the flow will do the * following: *
    - *
  1. Execute all registered end actions ({@link #getEndActionList()}).
  2. Map data available in the flow - * execution control context into provided output map using a registered output mapper ( - * {@link #setOutputMapper(Mapper)}).
  3. + *
  4. Execute all registered end actions ({@link #getEndActionList()}).
  5. + *
  6. Map data available in the flow execution control context into provided output map using a registered output + * mapper ( {@link #setOutputMapper(Mapper)}).
  7. *
* @param context the flow execution control context * @param outcome the logical flow outcome that will be returned by the session, generally the id of the terminating