|
38 | 38 | WorkflowAPIAdapter,
|
39 | 39 | )
|
40 | 40 |
|
41 |
| -from .decoder import get_workflow_input_names_for_step, set_step_variables |
| 41 | +from .decoder import ( |
| 42 | + get_workflow_input_names_for_step, |
| 43 | + get_workflow_output_values_for_step, |
| 44 | + set_step_variables, |
| 45 | +) |
42 | 46 |
|
43 | 47 | _LOGGER: logging.Logger = logging.getLogger(__name__)
|
44 | 48 | _LOGGER.setLevel(logging.INFO)
|
@@ -258,16 +262,24 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
|
258 | 262 | #
|
259 | 263 | # We then inspect the Workflow to determine the next step.
|
260 | 264 |
|
261 |
| - # ToDo |
| 265 | + wfid = rwf_response["workflow"]["id"] |
| 266 | + assert wfid |
| 267 | + wf_response, _ = self._wapi_adapter.get_workflow(workflow_id=wfid) |
| 268 | + _LOGGER.debug("API.get_workflow(%s) returned: -\n%s", wfid, str(wf_response)) |
262 | 269 |
|
| 270 | + if output_values := get_workflow_output_values_for_step(wf_response, step_name): |
| 271 | + # Got some output values |
| 272 | + # Inform the DM so it can link them to the Project directory |
| 273 | + self._wapi_adapter.realise_outputs( |
| 274 | + running_workflow_step_id=r_wfsid, |
| 275 | + outputs=output_values, |
| 276 | + ) |
| 277 | + |
| 278 | + # Now we can mark this step as DONE... |
263 | 279 | self._wapi_adapter.set_running_workflow_step_done(
|
264 | 280 | running_workflow_step_id=r_wfsid,
|
265 | 281 | success=True,
|
266 | 282 | )
|
267 |
| - wfid = rwf_response["workflow"]["id"] |
268 |
| - assert wfid |
269 |
| - wf_response, _ = self._wapi_adapter.get_workflow(workflow_id=wfid) |
270 |
| - _LOGGER.debug("API.get_workflow(%s) returned: -\n%s", wfid, str(wf_response)) |
271 | 283 |
|
272 | 284 | # We have the step from the Instance that's just finished,
|
273 | 285 | # so we can use that to find the next step in the Workflow definition.
|
|
0 commit comments