Skip to content
Snippets Groups Projects
Commit 38b16695 authored by Riccardo Boero's avatar Riccardo Boero :innocent:
Browse files

Fix workflow task parsing

parent d600731c
No related branches found
No related tags found
No related merge requests found
name = "FACT_workflow_manager"
uuid = "34b7aff1-f91f-4b8b-9a3d-d0a54f07d855"
authors = ["Riccardo Boero <ribo@nilu.no>"]
version = "0.0.10"
version = "0.0.11"
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
......
......@@ -111,12 +111,12 @@ manage_workflow(tasks_list, results_container, system)
```
"""
function manage_workflow(tasks_list::Vector{Dict}, results_container::Dict, system::OrchestratorRegistry.ServiceRegistry)
overwrite = true
update_condition = Atomic{Bool}(false) # Flag for saving updates
# Convert tasks_list into a dictionary for dependency resolution
tasks = Dict(task["id"] => task for task in tasks_list)
overwrite = true
update_condition = Atomic{Bool}(false) # Flag for saving updates
# Initialize a Dict to hold Channels for each task
task_channels = Dict{String, Channel{Bool}}()
for task_id in keys(tasks)
......@@ -149,6 +149,10 @@ function manage_workflow(tasks_list::Vector{Dict}, results_container::Dict, syst
# Wait for dependencies
if haskey(task_info, "dependencies") && !isempty(task_info["dependencies"])
for dep in task_info["dependencies"]
# Check that the dependency exists in task_channels
if !haskey(task_channels, dep)
error("Dependency $dep not found in task channels for task $task_id.")
end
take!(task_channels[dep])
put!(task_channels[dep], true) # Reput the signal for other tasks
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment