@@ -20,7 +20,6 @@ import org.springframework.webflow.engine.Transition;
2020import org.springframework.webflow.engine.Flow ;
2121import org.springframework.webflow.engine.builder.AbstractFlowBuilder ;
2222import org.springframework.webflow.engine.builder.FlowBuilderException ;
23- import org.springframework.webflow.engine.support.TransitionExecutingStateExceptionHandler ;
2423import org.springframework.webflow.core.collection.LocalAttributeMap ;
2524import org.springframework.webflow.execution.Event ;
2625import org.apache.commons.logging.LogFactory
@@ -36,6 +35,7 @@ import org.springframework.context.ApplicationContextAware
3635import org.springframework.context.ApplicationContext
3736import org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder
3837import org.codehaus.groovy.grails.web.mapping.UrlCreator
38+ import org.springframework.webflow.engine.support.TransitionExecutingFlowExecutionExceptionHandler
3939
4040/**
4141* <p >A builder implementation used to construct Spring Webflows. This is a DSL specifically
@@ -101,7 +101,9 @@ class FlowBuilder extends AbstractFlowBuilder implements GroovyObject, Applicati
101101 this . flowClosure. call();
102102 flowDefiningMode = false ;
103103 initialised = true ;
104- return super . getFlow();
104+ Flow flow = super . getFlow()
105+ flow. attributeMap. put(" persistenceContext" , true )
106+ return flow;
105107 }
106108 else if (flowDefiningMode) {
107109 if (isFirstArgumentClosure(args)) {
@@ -133,9 +135,11 @@ class FlowBuilder extends AbstractFlowBuilder implements GroovyObject, Applicati
133135 State state
134136 if (flowInfo. redirectUrl) {
135137 state = addEndState(name, flowInfo. redirectUrl );
138+ state. attributeMap. put(" commit" , true )
136139 }
137140 else if (trans. length == 0 && flowInfo. subflow == null ) {
138141 state = addEndState(name, name);
142+ state. attributeMap. put(" commit" , true )
139143 }
140144 else if (action) {
141145 // add action state
@@ -188,7 +192,9 @@ class FlowBuilder extends AbstractFlowBuilder implements GroovyObject, Applicati
188192 return state;
189193 }
190194 else {
191- return addEndState(name, name);
195+ State state = addEndState(name, name)
196+ state. attributeMap. put(" commit" , true )
197+ return state;
192198 }
193199 }
194200 else {
@@ -359,7 +365,7 @@ class TransitionTo {
359365 }
360366 public Object to (String newTo ) {
361367 if (error != null ) {
362- TransitionExecutingStateExceptionHandler handler = new TransitionExecutingStateExceptionHandler ();
368+ TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler ();
363369 handler. add(error, newTo);
364370 builder. getFlow(). getExceptionHandlerSet(). add(handler);
365371 return handler;
0 commit comments