1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.batch.core.job.flow.support.state;
18
19 import java.util.Collection;
20 import java.util.Collections;
21
22 import org.springframework.batch.core.job.flow.Flow;
23 import org.springframework.batch.core.job.flow.FlowExecutionStatus;
24 import org.springframework.batch.core.job.flow.FlowExecutor;
25 import org.springframework.batch.core.job.flow.FlowHolder;
26
27
28
29
30
31
32
33 public class FlowState extends AbstractState implements FlowHolder {
34
35 private final Flow flow;
36
37
38
39
40 public FlowState(Flow flow, String name) {
41 super(name);
42 this.flow = flow;
43 }
44
45
46
47
48 @Override
49 public Collection<Flow> getFlows() {
50 return Collections.singleton(flow);
51 }
52
53 @Override
54 public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
55 return flow.start(executor).getStatus();
56 }
57
58
59
60
61 @Override
62 public boolean isEndState() {
63 return false;
64 }
65
66 }