-
Notifications
You must be signed in to change notification settings - Fork 0
Launching steps
The workflow engine launches Steps (Jobs/Instances) in response to either a WorkflowMessage (START) message or a PodMessage (for a successful step completion).
A new workflow starts when the engine receives a WorkflowMessage where action="START"
.
The message will provide the UUID of a RunningWorkflow record. The engine must use this message property to obtain that record and that of the Workflow using the Workflow API given to the class initialiser. The engine will also use the InstanceLauncher, also given to the engine's class initialiser.
For the simple linear engine implementation the engine can assume that the first step declared in the workflow is the first step to execute.
As well as identifying the first step, one of the most important parts of the engine's responsibilities is the formation of a dictionary of variables that it needs to pass to the InstanceLauncher in order to actually start the step. The engine must provide names and values for all the variables the first step declares as inputs, options, and outputs.
As this is a complex process, and common to the actions required when continuing a workflow (see below), it is documented separately in Setting step variables.
When starting a workflow's first step the engine must do the following: -
- Use the API Adapter to create a RunningWorkflowStep record
- Determine the steps' variables and values (see Setting step variables)
- Optionally use the Data Manager Job Decoder to verify that the chosen variables and values satisfy the Step's Job command
- Save the step's variables in the RunningWorkflowStep. This is required to allow the use of a steps's variables in future steps.
- Create and populate a LaunchParameters object
- Call the InstanceLauncher
launch()
method, providing the LaunchParameters object.