WCP_04_Exclusive_choicein00choicesString_List_Differencelist11list21difference11net.sf.taverna.t2.activitieslocalworker-activity1.3net.sf.taverna.t2.activities.localworker.LocalworkerActivitylist11l('text/plain')java.lang.Stringtruelist21l('text/plain')java.lang.Stringtruedifference1l('text/plain')1workfloworg.embl.ebi.escience.scuflworkers.java.StringSetDifferencenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize1net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry1.0100050000net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoketruevalue00net.sf.taverna.t2.activitiesstringconstant-activity1.3net.sf.taverna.t2.activities.stringconstant.StringConstantActivitytruenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize1net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry1.0100050000net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokeString_List_Intersectionlist11list21intersection11net.sf.taverna.t2.activitieslocalworker-activity1.3net.sf.taverna.t2.activities.localworker.LocalworkerActivitylist11l('text/plain')java.lang.Stringtruelist21l('text/plain')java.lang.Stringtrueintersection1l('text/plain')1workfloworg.embl.ebi.escience.scuflworkers.java.StringSetIntersectionnet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize1net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry1.0100050000net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokechoiceBtoken0value00net.sf.taverna.t2.activitiesdataflow-activity1.3net.sf.taverna.t2.activities.dataflow.DataflowActivitynet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize1net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry1.0100050000net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokechoiceAtoken0value00net.sf.taverna.t2.activitiesdataflow-activity1.3net.sf.taverna.t2.activities.dataflow.DataflowActivitynet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize1net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry1.0100050000net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokeString_List_Differencelist1String_List_Differencelist2String_List_Intersectionlist1String_List_Intersectionlist2choiceBtokenchoiceAtokenchoiceschoicesStian Soiland-Reyes2012-02-20 22:55:19.930 WETf951f64d-eab5-40f0-828a-fac43feff1aa2012-02-20 23:02:16.772 WET5563b2f4-f2a0-42ea-8ee3-631937f7b4352012-02-20 23:11:35.816 WETThe choice of executing choiceA or choiceB is determined by using String_List_Intersection and 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. To extend this workflow with multiple choices, add several intersections, but use String_list_Union to feed them all to list2 of String_list_difference.
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.2012-02-20 23:10:37.60 WETWCP-04 Exclusive choice2012-02-20 22:56:35.606 WETd90e33db-00c0-4931-b476-60c8a929b5a22012-02-20 22:55:03.644 WETf4e6ca21-d3db-4237-947a-23bcbeb7315f2012-02-20 23:03:49.666 WET20ab0a18-e731-47d9-81dd-2647db2b47a92012-02-20 22:44:39.550 WETWorkflow9token00valueBvalue00net.sf.taverna.t2.activitiesstringconstant-activity1.3net.sf.taverna.t2.activities.stringconstant.StringConstantActivityBnet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize1net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry1.0100050000net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invokevalue4f2b6a9c-9364-4a9d-ba53-94c80d308df32012-02-20 23:02:47.1 WET2ae0f029-dcc4-4f60-a7c1-d648b9aeaf732012-02-20 22:42:16.635 WET4e8a0e99-05f7-4b50-b128-a5051e4604322012-02-20 22:43:21.50 WETb6b2d50a-d227-402f-869a-74cca3a88add2012-02-20 22:54:29.447 WETWorkflow9token00valueAvalue00net.sf.taverna.t2.activitiesstringconstant-activity1.3net.sf.taverna.t2.activities.stringconstant.StringConstantActivityAnet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize1net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry1.0100050000net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invokevalue4e8a0e99-05f7-4b50-b128-a5051e4604322012-02-20 22:43:21.50 WET3e7bfbc9-93ac-422f-a5f3-fd879a991f1b2012-02-20 22:54:45.277 WET0abe3d8f-bbdb-4098-acf5-5628f2efe5c92012-02-20 22:43:58.951 WET31d78948-00e5-4afe-b1e7-c85f2eb134d62012-02-20 23:03:28.615 WET2ae0f029-dcc4-4f60-a7c1-d648b9aeaf732012-02-20 22:42:16.635 WET