Add Workflow prepare/finish phases
A Workflow should change to have 3 "phases":
- prepare
- run
- finish
The current "workflow/sequence" will be the "run" phase.
The behavior when executing a job/workflow will be as
follows:
- Execute the "prepare" phase, on the server node only.
- if this phase exits without a successful result (non-zero exit
value) then:
- The entire Job finishes with the result state:
"prepare-not-successful"
- Otherwise, continue to the next phase.
- Execute the "run" phase, as the workflow currently executes
dispatched across nodes.
- retain the execution result of this phase for input to the next
phase
- continue to the next phase
- Execute the "finish" phase, on the server node only. It allows
a new expansion token "run.result" containing either 0 (success) or
non-zero (failure) result of phase 2.
- if this phase exits successfully, then the Job result status is
set to the result status of phase 2
- if this phase exits non-zero (failed), then Job result status
is set to: "finish-not-successful"
document definitions
the xml/yaml formats would have to be changed to support the 2
new phases. currently they have:
xml: <command.../>...
yaml:
sequence:
(metadata)
commands:
- item1...
For XML: add subsections to the <sequence>,
and migrate the existing <command> elements into
a <run> element...
<sequence ... >
<prepare>
<command .../>
<command .../>
</prepare>
<run>
<command .../>
<command .../>
</run>
<finish>
<command .../>
<command .../>
</finish>
</sequence>
For YAML: replace the "commands:" section with "run:" and add
"prepare:" and "finish: " sections:
sequence:
(metadata)
prepare:
- item1 ..
- item2...
run:
- item1...
- item2...
finish:
- item1...
- item2...
GUI
The web GUI for Job edit/create will have to change to support
the new phases. The GUI should indicate their semantics with text,
and reinforce their place as secondary to the main workflow
sequence for basic use cases.
By default for a new Job the Prepare/Finish would be shown as
secondary to the Run phase, perhaps with some kind of disclosure
button to show the full section if they are empty. Otherwise the
GUI widgets would be the same as for current workflow editor.
workflow:
keepgoing: False
Strategy: Node-oriented
Prepare phase: [+] Click to add. *All items must succeed for the workflow to continue*
Run: *Main workflow steps*
1. ...
2. ...
Finish: [+] Click to add. *Allows verification of Run results*