committed by
Mahmoud Ben Hassine
parent
7fd34829f9
commit
4a67b22e90
@@ -48,6 +48,7 @@ import org.springframework.core.task.TaskExecutor;
|
||||
* @author Dave Syer
|
||||
* @author Michael Minella
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @author Injae Kim
|
||||
* @since 2.2
|
||||
* @param <Q> the type of object returned by the builder (by default a Flow)
|
||||
*
|
||||
@@ -107,7 +108,8 @@ public class FlowBuilder<Q> {
|
||||
|
||||
/**
|
||||
* Transition to the next step on successful completion of the current step. All other
|
||||
* outcomes are treated as failures.
|
||||
* outcomes are treated as failures. If no steps are registered yet, then this method
|
||||
* will behave in the same way as {@link #start(Step)}.
|
||||
* @param step the next step
|
||||
* @return this to enable chaining
|
||||
*/
|
||||
@@ -250,26 +252,32 @@ public class FlowBuilder<Q> {
|
||||
if (this.currentState == null) {
|
||||
doStart(input);
|
||||
}
|
||||
State next = createState(input);
|
||||
addTransition("COMPLETED", next);
|
||||
addTransition("*", failedState);
|
||||
this.currentState = next;
|
||||
else {
|
||||
State next = createState(input);
|
||||
addTransition("COMPLETED", next);
|
||||
addTransition("*", failedState);
|
||||
this.currentState = next;
|
||||
}
|
||||
}
|
||||
|
||||
private void doStart(Object input) {
|
||||
if (this.currentState != null) {
|
||||
doFrom(input);
|
||||
}
|
||||
this.currentState = createState(input);
|
||||
else {
|
||||
this.currentState = createState(input);
|
||||
}
|
||||
}
|
||||
|
||||
private void doFrom(Object input) {
|
||||
if (currentState == null) {
|
||||
doStart(input);
|
||||
}
|
||||
State state = createState(input);
|
||||
tos.put(currentState.getName(), currentState);
|
||||
this.currentState = state;
|
||||
else {
|
||||
State state = createState(input);
|
||||
tos.put(currentState.getName(), currentState);
|
||||
this.currentState = state;
|
||||
}
|
||||
}
|
||||
|
||||
private State createState(Object input) {
|
||||
|
||||
Reference in New Issue
Block a user