Skip to content

Next state not found in flow='xyz' for state=abc.stepx with exit status=ABC_EFJ - FlowExecutionException #4348

Closed
@AJ198081

Description

@AJ198081

Bug description
The exception is thrown in all cases where the flow follow a path 'from().on().to()', for anything else it works

Environment
Java 17, Srping-boot 3.0.5, Spring-batch 5

Steps to reproduce

  1. Create a Job, that controls the flow based on step's ExitStatus code,
        return new JobBuilder("prepareFlowersJob", jobRepository)
                .start(selectFlowersStep())
                .on(FlowerSelectionStepExecutionListener.NO_TRIM_REQUIRED).to(arrangeFlowersStep())
                .from(selectFlowersStep()).on(FlowerSelectionStepExecutionListener.TRIM_REQUIRED).to(removeThornsStep())
                .from(removeThornsStep()).next(arrangeFlowersStep())
                .end()
                .build();

I have added the photos of the 'stateTransitions' list from SimpleFlow.java in debug mode which show that the there is no transition from step0 (selectFlowerStep()) when 'Trim Required',
in fact it shows the transition from step2 when 'Trim Required', it appears that 'from()' doesn't create the transition from 'selectFlowersStep()' but instead creates a new Step altogether.

Hopefully the images will be uploaded properly, doesn't look like.. If photos don't upload please have a look at this Issue, I have added there earlier today.

image

Here is the [link to my project ](https://github.com/AJ198081/spring-batch/blob/master/src/main/java/dev/aj/springbatch/config/jobs/BatchJob.java

Expected behavior
The job flow should execute for all control paths

Minimal Complete Reproducible example
The code throws the next State not found - FlowExecutionException
image

image

image

Successful execution - when step1() ExitCode is 'Rose' -
image

FlowExecutionException - when step1 ExitCode is 'Lotus' -
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions