Skip to content

Improve rendering of conditional blocks in DAG preview #88

Open
@bentsherman

Description

@bentsherman

Given the following workflow:

workflow GREET {
    take:
    message
    parallel

    main:
    if( parallel ) {
        sayHello(message).view()
    }
    else {
        println "This message is short so I'll just say it: ${message}"
    }
}

process sayHello {
    input:
    val message

    exec:
    println "This message must be pretty long if you used a process to say it: ${message}"
}

It will produce the following DAG preview:

flowchart TB
    subgraph GREET
    subgraph take
    v1["parallel"]
    v0["message"]
    end
    v2([sayHello])
    v0 --> v2
    end
Loading

The parallel input is not linked to the process because it is not linked to the process inputs, but it is an "input" in a way because it controls whether the process is run.

I think the best way to handle this would be to draw a subgraph for the conditional block (either the entire if/else or separate blocks for if and else) and connect the conditional input to the subgraph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions