Fix next handling in ComponentFlow

- This fixes a bug where returning null from a next()
  didn't stop a flow.
- Backport #510
- Fixes #513

(cherry picked from commit 7c4700b7b5)
This commit is contained in:
Janne Valkealahti
2022-08-22 13:06:13 +01:00
parent 9087692999
commit 2cf712328c
10 changed files with 128 additions and 20 deletions

View File

@@ -21,9 +21,6 @@
[12.734384, "o", "\u001b[?1l\u001b>\u001b[?12;25h\u001b[K"]
[12.740754, "o", "\u001b[32;1m?\u001b[0m \u001b[97;1mField1\u001b[0m \u001b[34mdefaultField1Value\u001b[0m\r\n"]
[12.74362, "o", "\u001b[?1h\u001b=\u001b[?25l"]
[12.750944, "o", "\u001b[32;1m?\u001b[0m \u001b[97;1mField2\u001b[0m \u001b[34m[Default defaultField2Value]\u001b[0m\r"]
[13.542429, "o", "\u001b[?1l\u001b>\u001b[?12;25h\u001b[K"]
[13.545672, "o", "\u001b[32;1m?\u001b[0m \u001b[97;1mField2\u001b[0m \u001b[34mdefaultField2Value\u001b[0m\r\n"]
[13.547149, "o", "\u001b[?1h\u001b=\u001b[?2004h\u001b[33mmy-shell:>\u001b[0m"]
[14.091367, "o", "\u001b[1mflow conditional\u001b[0m"]
[14.419251, "o", "\r\r\n\u001b[?1l\u001b>\u001b[?1000l\u001b[?2004l"]

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -19,6 +19,10 @@ include::{snippets}/FlowComponentSnippets.java[tag=snippet1]
image::images/component-flow-showcase-1.svg[text input]
Normal execution order of a components is same as defined with a builder. It's
possible to conditionally choose where to jump in a flow by using a `next`
function and returning target _component id_. If this returned id is aither _null_
or doesn't exist flow is essentially stopped right there.
====
[source, java, indent=0]