Skip to content

Fortified IDDocs

Flow data and Step Pipes

How flow data is accumulated and passed to pipes in Forms.

A flow starts by initialising two state objects: the Accumulated Flow State, and the Accumulated Flow Delta. If an initialising pipe is configured, that pipe is executed and the result, which must be a single, flat key/value object, is added to the Accumulated Flow State.

During the progression of a Flow, data from each step is accumulated in both state objects according to certain rules.

The data in the Accumulated Flow State can be referenced using the prefix flow, combined with the property name available in the accumulated state. These values often come from controls, but can also come from input data, pre-pipe output, and pipe output added during the flow.

The data in the Accumulated Flow Delta is sent to the pipes configured to run throughout the flow.

Example references:

  • flow.cn
  • flow.description

When a step pipe or finalize pipe runs, the request is built from the Accumulated Flow Delta together with input data and any configured pipe request parameters.

As the flow transitions from one step to the next, a number of things happen:

  1. Each Control in the current step contributes its data to the Accumulated Flow State. For read only Controls, no change is accepted.
  2. Each Control in the current step is inspected to see if it has data to contribute to the Accumulated Flow Delta. A Control only contributes data to the Delta if at least one of the following conditions holds true:
    • The data that the Control holds has changed since the Step was loaded.
    • The Control property always_include is set to true.
  3. If a pipe function is associated with the current step, that pipe is called with the Accumulated Flow Delta, i.e. accumulated changed data from all steps up to and including the current one.
  4. The data in the response from the pipe function, which must be a single, flat key/value object, is added to the Accumulated Flow State.

Each Control contributes output to the Accumulated Flow State. The Accumulated Flow Delta only receives output for controls whose value changed, or where always_include is enabled. The flowchart below visualises these rules. At the end of each step, before transitioning to the next or ending the flow, each Control is checked according to the flowchart. When all Controls have been processed, the associated step pipe, if configured, is executed with the Accumulated Flow Delta as parameter. The pipe response is then added to the Accumulated Flow State.

---
config:
layout: dagre
---
flowchart TD
B("Check Control C") --> C{"ReadOnly?"}
C -- No --> D{"Required?"}
C -- Yes --> E{"Required?"}
E -- No --> F("Add C(D) to <b>S</b>")
E -- Yes --> I{"C(D) empty?"}
I -- No --> F
I -- Yes --> J("Error")
F --> K1{"Always Include?"}
K1 -- Yes --> H("Add C(D) to <b>&Delta;</b>")
K1 -- No --> G(("Repeat for all <br> Controls in Step"))
H --> G
D -- Yes --> K{"C(I) empty?"}
D -- No --> L("Add C(I) to <b>S</b>")
K -- No --> L
M -- Yes --> G
K -- Yes --> J
L --> N1{"Always Include?"}
N1 -- Yes --> N("Add C(I) to <b>&Delta;</b>")
N1 -- No --> M{"C(I) = C(D)?"}
M -- No --> N
N --> G
G --> S("If step has pipe:
<b>R</b> = <b>P</b>(<b>&Delta;</b>)
Add <b>R</b> to <b>S</b>")
S --> P{"Has more Steps?"}
P -- Yes --> Q("Next Step")
P -- No --> R("Summary")
subgraph n1["C: Control<br>D: initial data
I: Input
<b>&Delta;</b>: Accumulated Delta
<b>S</b>: Accumulated State
<b>P</b>: Pipe function associated with step"]
end