galaxy icon indicating copy to clipboard operation
galaxy copied to clipboard

More expressive conditionals

Open bernt-matthias opened this issue 2 years ago • 4 comments

Few ideas to make conditionals more expressive:

  • allow for when tags match multiple options:

    • comma separated list <when value="option1,option2"/> or
    • even more powerful regexes <when value="option1|option2"/> (with <when value="option*"/> it might even be useful for dynamic options) which would solve https://github.com/galaxyproject/galaxy/issues/3428
  • add something like an else branch for conditionals (e.g. <else>)

    • in particular useful if conditionals with dynamic options would be supported
  • allow when tags appear multiple times. which might allow for a more logical structuring of the tool form

<conditional...>
    <param type="select"...>
    <when value="A"/>
    <when value="B"/>
    <when value="A"/>
</conditional>
  • allow multiple="true" for the select https://github.com/galaxyproject/galaxy/issues/7173

    • This could be useful for instance if a program has several actions that can be applied and each action has its own set of parameters. This way the user gets only those options that are relevant for her choice. For instance show multiple levels / types of advanced options.
    • Might be as well solved by macros, but still this makes the final tool xml larger
  • allow optional="true"

    • could allow for none of these, without adding another artificial option with a empty when tag

Potential problem:

  • even more complicated workflow logic: eg https://github.com/galaxyproject/galaxy/issues/4528

bernt-matthias avatar May 19 '22 12:05 bernt-matthias

Personal communication with @nsoranzo

We should use a different attribute than value if we use regular expressions.

bernt-matthias avatar May 19 '22 17:05 bernt-matthias

If we do this it should be something that we can evaluate on the client as well, otherwise we'll be dealing with loads of invalid workflow connections that we can't validate in the editor.

mvdbeek avatar Sep 16 '22 17:09 mvdbeek

If we do this

You mean regular expressions? Maybe this can be a 2nd step...

bernt-matthias avatar Sep 17 '22 11:09 bernt-matthias

Any new way to specify and evaluate conditionals, these are probably the biggest hurdle in creating workflows .

mvdbeek avatar Sep 17 '22 11:09 mvdbeek