private void buildSubJobBatchWorkUnits() {

		List<Flow> flows = this.split.getFlows();

		parallelBatchWorkUnits = new ArrayList<BatchFlowInSplitWorkUnit>();

		// Build all sub jobs from flows in split
		synchronized (subJobs) {
			for (Flow flow : flows) {
				subJobs.add(PartitionedStepBuilder.buildFlowInSplitSubJob(jobContext, this.split, flow));
			}
			// Go back to earlier idea that we may have seen this id before, and need a special "always restart" behavior
			// for split-flows.
			for (JSLJob job : subJobs) {				
				int count = batchKernel.getJobInstanceCount(job.getId());
				FlowInSplitBuilderConfig config = new FlowInSplitBuilderConfig(job, completedWorkQueue, rootJobExecutionId);
				if (count == 0) {
					parallelBatchWorkUnits.add(batchKernel.buildNewFlowInSplitWorkUnit(config));
				} else if (count == 1) {
					parallelBatchWorkUnits.add(batchKernel.buildOnRestartFlowInSplitWorkUnit(config));
				} else {
					throw new IllegalStateException("There is an inconsistency somewhere in the internal subjob creation");
				}
			}
		}
	}
private void buildSubJobBatchWorkUnits ( ) { List < Flow > flows = this . split . getFlows ( ) ; parallelBatchWorkUnits = new ArrayList < BatchFlowInSplitWorkUnit > ( ) ; synchronized ( subJobs ) { for ( Flow flow : flows ) { subJobs . add ( PartitionedStepBuilder . buildFlowInSplitSubJob ( jobContext , this . split , flow ) ) ; } for ( JSLJob job : subJobs ) { int count = batchKernel . getJobInstanceCount ( job . getId ( ) ) ; FlowInSplitBuilderConfig config = new FlowInSplitBuilderConfig ( job , completedWorkQueue , rootJobExecutionId ) ; if ( count == 0 ) { parallelBatchWorkUnits . add ( batchKernel . buildNewFlowInSplitWorkUnit ( config ) ) ; } else if ( count == 1 ) { parallelBatchWorkUnits . add ( batchKernel . buildOnRestartFlowInSplitWorkUnit ( config ) ) ; } else { throw new IllegalStateException ( "There is an inconsistency somewhere in the internal subjob creation" ) ; } } } }
Note we restart all flows.  There is no concept of "the flow completed".   It is only steps
within the flows that may have already completed and so may not have needed to be rerun.