Dummy_example_of_loopingjobIdinitial_valuestateresultcreateJobjobId00value00net.sf.taverna.t2.activitiesbeanshell-activity1.0net.sf.taverna.t2.activities.beanshell.BeanshellActivity workflow 0 jobId 0 0 value 0 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry 1.0 1000 5000 0 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokecheckStatusjobId0state00net.sf.taverna.t2.activitiesbeanshell-activity1.0net.sf.taverna.t2.activities.beanshell.BeanshellActivity workflow java.lang.String true jobId 0 text/plain 0 state 0 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Loop <activity xmlns="http://taverna.sf.net/2008/xml/t2flow"><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.0</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap /><outputMap /><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns=""> <script>loop = "" + state.equals("RUNNING"); if ("true".matches(loop)) { Thread.sleep(500); }</script> <dependencies /> <classLoaderSharing>workflow</classLoaderSharing> <localDependencies /> <artifactDependencies /> <inputs> <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> <translatedElementType>java.lang.String</translatedElementType> <allowsLiteralValues>true</allowsLiteralValues> <name>state</name> <depth>0</depth> </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> </inputs> <outputs> <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean> <granularDepth>0</granularDepth> <name>loop</name> <depth>0</depth> </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean> </outputs> </net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity> true net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry 1.0 1000 5000 0 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokegetResultsjobId0value00net.sf.taverna.t2.activitiesbeanshell-activity1.0net.sf.taverna.t2.activities.beanshell.BeanshellActivity workflow java.lang.String true jobId 0 text/plain 0 value 0 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize 1 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBouncenet.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failovernet.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry 1.0 1000 5000 0 net.sf.taverna.t2.coreworkflowmodel-impl1.0net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.InvokecheckStatusjobIdcreateJobjobIdgetResultsjobIdcreateJobjobIdjobIdcreateJobjobIdinitial_valuecreateJobvaluestatecheckStatusstateresultgetResultsvalue createJob creates a temporary file with the content "0". Filename retuirned as a "job ID". checkStatus reads the job, and return state "RUNNING" as long as the content is less than 10, increasing the number for each call. (As no actual job is being run) getResults reads the file content, with the condition 'Run after checkStatus'. In Details->Advanced for checkStatus you can check the loop condition for checkStatus, which says it will loop as long as the output 'state' is equal to 'RUNNING' - with a 0.5s delay. Thus when executing this workflow, checkStatus will be called repeatedly, and finally the 'result' should be '10' and 'state' should be 'COMPLETE'. See http://www.mygrid.org.uk/dev/wiki/display/scrap/Looping+in+Taverna+2.1 for details 2010-01-27 12:26:35.789 GMT Example of looping over asynchronous services. The dummy beanshell scripts represents the operations of an asynchronous submit-status-results style service, such as EBI's InterProScan and NCBI Blast. createJob creates a temporary file with the content "0". Filename retuirned as a "job ID". checkStatus reads the job, and return state "RUNNING" as long as the content is less than 10, increasing the number for each call. (As no actual job is being run) getResults reads the file content, with the condition 'Run after checkStatus'. In Details->Advanced for checkStatus you can check the loop condition for checkStatus, which says it will loop as long as the output 'state' is equal to 'RUNNING' - with a 0.5s delay. Thus when executing this workflow, checkStatus will be called repeatedly, and finally the 'result' should be '10' and 'state' should be 'COMPLETE'. See http://www.mygrid.org.uk/dev/wiki/display/scrap/Looping+in+Taverna+2.1 for details 2010-01-27 14:12:55.943 GMT createJob creates a temporary file with the content "0". Filename retuirned as a "job ID". checkStatus reads the job, and return state "RUNNING" as long as the content is less than 10, increasing the number for each call. (As no actual job is being run) getResults reads the file content, with the condition 'Run after checkStatus'. In Details->Advanced for checkStatus you can check the loop condition for checkStatus, which says it will loop as long as the output 'state' is equal to 'RUNNING' - with a 0.5s delay. Thus when executing this workflow, checkStatus will be called repeatedly, and finally the 'result' should be '10' and 'state' should be 'COMPLETE'. See 2010-01-27 12:26:26.818 GMT createJob creates a temporary file with the content "0". Filename retuirned as a "job ID". checkStatus reads the job, and return state "RUNNING" as long as the content is less than 10, increasing the number for each call. (As no actual job is being run) getResults reads the file content, with the condition 'Run after checkStatus'. In Details->Advanced for checkStatus you can check the loop condition for checkStatus, which says it will loop as long as the output 'state' is equal to 'RUNNING' - with a 0.5s delay. Thus when executing this workflow, checkStatus will be called repeatedly, and finally the 'result' should be '10' and 'state' should be 'COMPLETE'. 2010-01-27 12:19:42.220 GMT Dummy example of looping 2010-01-27 12:16:26.448 GMT Stian Soiland-Reyes 2010-01-27 12:16:13.17 GMT