Skip to content

Order of Transition Elements Does Not Adhere to Documentation #3638

Closed
@kmb385

Description

@kmb385

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.

Metadata

Metadata

Assignees

Labels

has: backportsLegacy label from JIRA. Superseded by "for: backport-to-x.x.x"type: bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions