From 493da73d35bf622f94845bb295a6093e562da661 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 24 Aug 2024 16:01:15 +0100 Subject: workflow: Retrieve outputs differently based on workflow class. * ravanan/workflow.scm (run-workflow): Retrieve outputs differently based on whether the workflow is a CommandLineTool class or a Workflow class. --- ravanan/workflow.scm | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/ravanan/workflow.scm b/ravanan/workflow.scm index d4d2c6c..d0afdde 100644 --- a/ravanan/workflow.scm +++ b/ravanan/workflow.scm @@ -212,8 +212,22 @@ authenticate to the slurm API with. @var{slurm-api-endpoint} and #:slurm-api-endpoint slurm-api-endpoint #:slurm-jwt slurm-jwt)) inputs))) - (vector-map->list (lambda (output) - (cons (assoc-ref output "id") - (assoc-ref cell-values - (assoc-ref output "outputSource")))) - (assoc-ref cwl "outputs")))) + (let ((class (assoc-ref* cwl "class"))) + (cond + ((string=? class "CommandLineTool") + (vector-map->list (lambda (output) + (let ((output-id (assoc-ref output "id"))) + (cons output-id + (or (assoc-ref cell-values output-id) + (error "output not found" output-id))))) + (assoc-ref cwl "outputs"))) + ((string=? class "ExpressionTool") + (error "Workflow class not implemented yet" class)) + ((string=? class "Workflow") + (vector-map->list (lambda (output) + (let ((output-id (assoc-ref output "id"))) + (cons output-id + (or (assoc-ref cell-values + (assoc-ref* output "outputSource")) + (error "output not found" output-id))))) + (assoc-ref cwl "outputs"))))))) -- cgit v1.2.3