Reputation: 103
I have a Spring batch Job which internally uses "splits' to run a sequence of steps in parallel.
For example:
Job's first step = "A"
"A" splits into 2 parallel flows:
1) B1 -> B2 -> B3 -> B4
2) C1 -> C2 -> C3 -> C4
B1, B2, B3 and B4 are sequential steps running in one spring batch "flow" and C1, C2, C3 and C4 are another set of sequential steps running in another spring batch "flow".
I want to run C3 only when B3 finishes. Is there any way to achieve this?
Upvotes: 0
Views: 171
Reputation: 31600
This is a more like a flow design issue rather than a feasibility issue with Spring Batch. You can't want to run two tasks in parallel where one task depends on the other. Going parallel means each flow can run independently from other flows running in parallel.
You need to redesign your flow using sub-flows. Since C3 depends on B3, you could probably split your flows into something like:
B1 -> B2
\
B3 -> B4
/ \
C1 -> C2 C3 -> C4
It is technically possible to do what you want without changing your flow definition (like using a shared boolean between B3 and C3 and make C3 wait on it) but this is an ugly work around the flow design issue.
Upvotes: 1