WCP_04_Exclusive_choicein00choicesString_List_Differencelist11list21difference11net.sf.taverna.t2.activitieslocalworker-activity1.3net.sf.taverna.t2.activities.localworker.LocalworkerActivity list1 1 l('text/plain') java.lang.String true list2 1 l('text/plain') java.lang.String true difference 1 l('text/plain') 1 workflow org.embl.ebi.escience.scuflworkers.java.StringSetDifference net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.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.Retry 1.0 1000 5000 0 net.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.StringConstantActivity true net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.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.Retry 1.0 1000 5000 0 net.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.LocalworkerActivity list1 1 l('text/plain') java.lang.String true list2 1 l('text/plain') java.lang.String true intersection 1 l('text/plain') 1 workflow org.embl.ebi.escience.scuflworkers.java.StringSetIntersection net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.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.Retry 1.0 1000 5000 0 net.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.Parallelize 1 net.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.Retry 1.0 1000 5000 0 net.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.Parallelize 1 net.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.Retry 1.0 1000 5000 0 net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokeString_List_Differencelist1inString_List_Differencelist2String_List_IntersectionintersectionString_List_Intersectionlist1inString_List_Intersectionlist2truevaluechoiceBtokenString_List_DifferencedifferencechoiceAtokenString_List_IntersectionintersectionchoiceschoiceAvaluechoiceschoiceBvalue Stian Soiland-Reyes 2012-02-20 22:55:19.930 WET f951f64d-eab5-40f0-828a-fac43feff1aa 2012-02-20 23:02:16.772 WET 5563b2f4-f2a0-42ea-8ee3-631937f7b435 2012-02-20 23:11:35.816 WET The 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 WET WCP-04 Exclusive choice 2012-02-20 22:56:35.606 WET d90e33db-00c0-4931-b476-60c8a929b5a2 2012-02-20 22:55:03.644 WET f4e6ca21-d3db-4237-947a-23bcbeb7315f 2012-02-20 23:03:49.666 WET 20ab0a18-e731-47d9-81dd-2647db2b47a9 2012-02-20 22:44:39.550 WET Workflow9token00valueBvalue00net.sf.taverna.t2.activitiesstringconstant-activity1.3net.sf.taverna.t2.activities.stringconstant.StringConstantActivity B net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.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.Retry 1.0 1000 5000 0 net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokevalueBvalue 4f2b6a9c-9364-4a9d-ba53-94c80d308df3 2012-02-20 23:02:47.1 WET 2ae0f029-dcc4-4f60-a7c1-d648b9aeaf73 2012-02-20 22:42:16.635 WET 4e8a0e99-05f7-4b50-b128-a5051e460432 2012-02-20 22:43:21.50 WET b6b2d50a-d227-402f-869a-74cca3a88add 2012-02-20 22:54:29.447 WET Workflow9token00valueAvalue00net.sf.taverna.t2.activitiesstringconstant-activity1.3net.sf.taverna.t2.activities.stringconstant.StringConstantActivity A net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.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.Retry 1.0 1000 5000 0 net.sf.taverna.t2.coreworkflowmodel-impl1.3net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokevalueAvalue 4e8a0e99-05f7-4b50-b128-a5051e460432 2012-02-20 22:43:21.50 WET 3e7bfbc9-93ac-422f-a5f3-fd879a991f1b 2012-02-20 22:54:45.277 WET 0abe3d8f-bbdb-4098-acf5-5628f2efe5c9 2012-02-20 22:43:58.951 WET 31d78948-00e5-4afe-b1e7-c85f2eb134d6 2012-02-20 23:03:28.615 WET 2ae0f029-dcc4-4f60-a7c1-d648b9aeaf73 2012-02-20 22:42:16.635 WET