Parses a workflow configuration file in TOML format to extract the tasks and global settings.
Parses a workflow configuration file in TOML format to extract the tasks defined in the workflow.
# Arguments
- `filePath::String`: The path to the workflow configuration file in TOML format.
# Returns
- `(Dict, Dict)`: A tuple containing two dictionaries. The first dictionary contains the tasks defined in the workflow file, with each task's properties and configurations. The second dictionary contains global settings that apply to the entire workflow.
- `Dict{String, Any}`: A dictionary containing the tasks defined in the workflow file. Each key represents a task name, and the value is another dictionary containing the task's properties and configurations.
# Behavior
- Reads the specified TOML file and checks for a `tasks` section.
- Returns the `tasks` dictionary if it exists.
- Throws an error if the `tasks` section is missing.
# Raises
- `Error`: If the `tasks` section is not found in the TOML file.
This function reads the specified TOML file, parsing the defined tasks and global settings into separate dictionaries for further processing in the workflow management system.
This function reads the specified TOML file, ensuring the presence of a `tasks` section and parsing it into a dictionary for further processing in the workflow management system.
"""
function parseWorkflow(filePath::String)
# Parse the workflow file
config=TOML.parsefile(filePath)
tasks=config["tasks"]
returntasks
data=TOML.parsefile(filePath)
ifhaskey(data,"tasks")
returndata["tasks"]# Return the tasks dictionary
else
error("Invalid workflow file: 'tasks' section not found.")