Description
In the documentation it provides this example:
@Bean
public Job job() {
return this.jobBuilderFactory.get("job")
.start(stepA())
.on("*").to(stepB())
.from(stepA()).on("FAILED").to(stepC())
.end()
.build();
}
And then states:
The framework automatically orders transitions from most specific to least specific.
This means that, even if the ordering were swapped for "stepA" in the example above, an ExitStatus of "FAILED" would still go to "stepC".
I have noticed the ordering of the transition elements seems to matter. An exception thrown in stepA
still sends execution of the job to StepB
. If I reorder the transition elements to:
@Bean
public Job job() {
return this.jobBuilderFactory.get("job")
.start(stepA())
.on("FAILED").to(stepC())
.from(stepA()).on("*").to(stepB())
.end()
.build();
}
The job routes correctly causing a failed stepA
to direct the flow to stepB
. Either I'm interpreting the documentation incorrectly, there is an issue with my simple example or the framework is not behaving according to the documentation.
After roughly an hour of testing, it seems to me the order of the transition elements must be specified from most specific to least specific.