I am trying to configure a thread in a spring package using java-config, this thread should basically do this:
Perform the init step (which adds the entry to the database)
then execute the solution to check the existence of the file,
2.1. If the files exist, it will execute the download task (this is another thread with a parallel bunch of steps)
- Perform the completion step (which adds the record to the database), this should always be done, even if 2.1 has not been completed.
I tried to complete this setup, but the completion step never starts:
Flow flow = new FlowBuilder<SimpleFlow>("commonFlow") .start(stepBuilderFactory.get("initStep").tasklet(initTasklet).build()) .next(decider) .on(FlowExecutionStatus.COMPLETED.getName()) .to(splitFlow) .from(decider).on("*") .end() .next(stepBuilderFactory.get("finishStep").tasklet(finishTasklet).build()) .end();
I can make it work as shown below, but it is not elegant:
Step finishStep = stepBuilderFactory.get("finishStep").tasklet(finishTasklet).build(); Flow flow = new FlowBuilder<SimpleFlow>("commonFlow") .start(stepBuilderFactory.get("initStep").tasklet(initTasklet).build()) .next(decider) .on(FlowExecutionStatus.COMPLETED.getName()) .to(splitFlow) .next(finishStep) .from(decider).on("*") .to(finishStep) .end();
Does anyone know how to correctly complete the step after making a decision using java-config?
source share