The Run Dialog should look similar but not identical to that for Taverna 1.7.1. This is by no means the ideal solution, but should work. I think the codebase from Taverna 2 can be used with suitable editing.
Top of dialog contains
- the title (or name if no title) of the workflow being run
- description (if any) and
Left hand side contains a tree (1) where
- the root is called "Input values"
- there is a top-level node for each workflow input port
- if the port has associated values then these are shown in the tree
- if the value is a string that is long then it can be ellipsised
- the tree may need to be in a scroll pane
The tree must allow dragging of nodes within it and also the dropping of files or URLs into it. This code is already in Taverna 2.
If a node (apart from the root node) of the tree is selected (in other words this is available when you can determine the port) then the user can click
- add string
- add file
- add URL
- add list (if applicable)
All but "Add string" work as in Taverna 2 i.e. they fill in the list depths and "Add list" gives options. "Add string" is equivalent to "New string" in Taverna 2. Delete removes the corresponding node and its subnodes (if any).
When a node is added to the tree, it is automatically selected.
When a node in the tree is selected, the right hand pane is blank unless the node is a leaf.
If a leaf node is selected, then the value is shown in the right hand panel (2). The right hand panel should be scrollable in case of large values.
If the value is a string value then the right hand panel is editable. The edited value is copied when the right hand panel loses focus. Note that I do not like this but it is how Taverna 1 works, and also the metadata editing.
If the value is a file, then the contents of the file are rendered in the right hand panel. Do not waste time trying to do anything clever if it is something other than text. If the file contains text and the user tries to edit it, then a confirmation/warning dialog should be popped up. If the user says "OK I want to edit it", then the contents of the file are copied into a string value. Note that the user is editing a string that is initialized with the contents of the file. It is not editing the file itself. A similar thing is done for URLs. Some mechanism needs to be used to check that the file contains a string. The value of the node becomes a string value.
When "Run workflow" is clicked, then the workflow is run with the values.
Remembering of values
When the run dialog is opened, if the workflow being run has previously been run, then for each of its current ports, if in the previous run there was a port of the same name and of the same depth, then the tree of values should be loaded with the values used for the previous run. You do not need to be able to fill in values for all of the current ports, nor do you need to reuse all of the values from the previous ports.
I think this can be done by keeping a map of
workflow -> port name map
where port name map is
port name -> data reference
When the workflow is launched, the values are saved to the map (of maps). When the dialog is opened, the map (of maps) is examined and for each port of the workflow, the previous data for that name is fetched and if its depth matches the depth of the current port, then that value is loaded into the tree.
Alternatively, the cloning could be delayed until the workflow is actually run.
The users want to keep the dialog up-to-date with the workflow edits and to keep it open. This is very desirable but if it can't be done fairly quickly, don't do it. Katy says that this is confusing for novice users and that the re-entering of values is neater.