Skip to content

next does not work as expected in ComponentFlow #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mcseemz opened this issue Aug 19, 2022 · 0 comments · Fixed by #514
Closed

next does not work as expected in ComponentFlow #510

mcseemz opened this issue Aug 19, 2022 · 0 comments · Fixed by #514
Labels
for/backport For backporting type/bug Is a bug report
Milestone

Comments

@mcseemz
Copy link

mcseemz commented Aug 19, 2022

Hello.
This code always asks for a second input ("skill") in spite of the "next" set to null.

        ComponentFlow.ComponentFlowResult run = componentFlowBuilder.clone().reset()
                .withSingleItemSelector("hero")
                .selectItems(heroes)
                .max(10)
                .next(x -> null)
                .and()
                .withSingleItemSelector("skill")
                .selectItems(skills)
                .max(10)
                .and()
                .build().run();

And in
https://docs.spring.io/spring-shell/docs/2.1.1/site/reference/htmlsingle/#using-shell-components-flow
It is expected to break the sequence and finish. At least that can be understood from the code, as there is no explanation for the logic in the docs.

@jvalkeal jvalkeal changed the title .next() does not work as expected in ComponentFlow next() does not work as expected in ComponentFlow Aug 22, 2022
@jvalkeal jvalkeal changed the title next() does not work as expected in ComponentFlow next does not work as expected in ComponentFlow Aug 22, 2022
@jvalkeal jvalkeal added the type/bug Is a bug report label Aug 22, 2022
@jvalkeal jvalkeal added this to the 3.0.0-M1 milestone Aug 22, 2022
@jvalkeal jvalkeal added the for/backport For backporting label Aug 22, 2022
jvalkeal added a commit to jvalkeal/spring-shell that referenced this issue Aug 22, 2022
- This fixes a bug where returning null from a next()
  didn't stop a flow.
- Fixes spring-projects#510
jvalkeal added a commit that referenced this issue Aug 22, 2022
- This fixes a bug where returning null from a next()
  didn't stop a flow.
- Backport #510
- Fixes #513

(cherry picked from commit 7c4700b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for/backport For backporting type/bug Is a bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants