Closed rogerhutchings closed 3 years ago
Time estimate: 1 dev, 1 week
Workflow steps ADR has an example of how branching logic will be supported with workflow steps: https://github.com/zooniverse/front-end-monorepo/blob/master/docs/arch/adr-05.md#decision
This also can be developed against the kitteh zoo staging project as the first step/task should be a branching single choice question.
I've created draft PRs for two of likely a few approaches:
next
property to Step
, similar to what intended for recursive workflows as stated in https://github.com/zooniverse/front-end-monorepo/blob/master/docs/arch/adr-05.md#decisionstep.next
forces a rerender. I could refactor isThereANextStep
similar to #1748, though I'm not sure that's a good idea or proper MST/observables usage.next
to workflowStepStore
Going Back/Previous breaks either at the moment.
In this test workflow - https://master.pfe-preview.zooniverse.org/lab/1693/workflows/3428, it should go: single q (0, 1, 2) 0 - complete 1 - drawing, then complete 2 - text, then complete However, after the drawing task it advances to the text task, because the workflow step store does not currently account for the next task setting (on any task, including the branching of the single question task). Is this what we refer to as a recursive workflows, and is therefor out of scope of this issue? That's fine, I can just focus on advancing from a single choice question, but they're (single choice branching, any task next's setting, going back/previous) so interrelated I'm not sure if should be considered at same time?
After discussing this with @mcbouslog, we've realized that once a branching has occurred, we will always need to explicitly know what step is next and previous. Say a branching workflow looks like this:
|Step A| |.......... | |...........| [B]......[C] |............| [D].......[E]
So A -> B -> D or A -> C -> E
And the step map looks like this: [[A],[B],[C],[D],[E]]
We can't rely on the map order once the branching happens.
So, we need to tweak how this works and define a next
and previous
for all steps:
How to determine the previous step with branching still needs some thought.
We'll need to write up an updated ADR for these changes.
Package
lib-classifier