Skip to content

Commit 1d2da3e

Browse files
Merge pull request #26 from InformaticsMatters/sc-3475
Add realise_outputs()
2 parents f10ab35 + a81551c commit 1d2da3e

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

tests/wapi_adapter.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,10 @@ def get_running_workflow_steps(self, *, running_workflow_id: str) -> dict[str, A
360360
item["id"] = key
361361
steps.append(item)
362362
return {"count": len(steps), "running_workflow_steps": steps}
363+
364+
def realise_outputs(
365+
self, *, running_workflow_step_id: str, variables: dict[str, str]
366+
) -> tuple[dict[str, Any], int]:
367+
del running_workflow_step_id
368+
del variables
369+
return {}, 0

workflow/workflow_abc.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ class WorkflowAPIAdapter(ABC):
126126
"""The APIAdapter providing read/write access to various Workflow tables and records
127127
in the Model that is owned by the DM. It provides the ability to create and retrieve
128128
Workflow, RunningWorkflow and RunningWorkflowStep records returning dictionary
129-
(API-like) responses."""
129+
(API-like) responses.
130+
131+
This adapter also provides methods to copy outputs to the
132+
corresponding Project from Workflow steps that generate outputs."""
130133

131134
@abstractmethod
132135
def get_workflow(
@@ -318,6 +321,17 @@ def get_job(
318321
# }
319322
# If not present an empty dictionary should be returned.
320323

324+
@abstractmethod
325+
def realise_outputs(
326+
self, *, running_workflow_step_id: str, outputs: list[str]
327+
) -> tuple[dict[str, Any], int]:
328+
"""Copy (link) the step's files as outputs into the Project directory.
329+
A step ID is provided, along with a list of outputs (files)."""
330+
# Should return an empty map or:
331+
# {
332+
# "error": "<error message>",
333+
# }
334+
321335

322336
class MessageDispatcher(ABC):
323337
"""The class handling the sending of messages (on the Data Manager message bus)."""

0 commit comments

Comments
 (0)