WCP-04 Exclusive choice - if/else branching
The choice of executing choiceA or choiceB is determined by using String_List_Intersection and String_List_Difference. If in="true" then the intersection will yield a non-empty list, triggering execution of choiceA. This list will however not differ from the input, and so choiceB will iterate over an empty list (ie. not execute).
Note how using 'difference' for the else-case here means that if you run the workflow with in="bob", choiceB would still run. Some early if/else workflows for Taverna 1 using Fail_if_false and conditional run would in these cases run both choices.
To extend this workflow with multiple choices, add several intersections, but use String_list_Union to feed the intersected lists to list2 of String_list_difference.
If no else-case is needed, simply delete String_list_difference and choiceB.
The nested workflows wrap the chosen services A and B, thereby the services do not need to support receiving the token.
It is important to note that in this workflow 'in' is an input port at depth 0 so that only a single value is 'chosen' over the same time. If this was made depth 1, then several choices could be triggered. If you want to perform iterations over A and B (presumably taking some inputs), with individual choices, you need to wrap this workflow as a nested workflow and iterate over it.
Preview
Run
Run this Workflow in the Taverna Workbench...
Option 1:
Copy and paste this link into File > 'Open workflow location...'
http://myexperiment.org/workflows/2743/download?version=1
[ More Info ]
Workflow Components
Workflow Type
Version 1 (of 1)
Log in to add Tags
Shared with Groups (0)
None
Statistics
Reviews (0)
Other workflows that use similar services (0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment