<?xml version="1.0" encoding="UTF-8"?>
<workflow uri="http://www.myexperiment.org/workflow.xml?id=1028" resource="http://www.myexperiment.org/workflows/1028" version="2">
  <id>1028</id>
  <title>Dummy example of looping</title>
  <description>&lt;p&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: 13px; line-height: 13px; "&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;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&amp;nbsp;&lt;a href="http://www.biocatalogue.org/services/5-wsinterproscanservice_85990#operations" rel="nofollow" style="color: rgb(0, 0, 153); text-decoration: none; "&gt;InterProScan&amp;nbsp;&lt;/a&gt;and&amp;nbsp;&lt;a href="http://www.biocatalogue.org/services/44-wsncbiblastservice_863693#operations" rel="nofollow" style="color: rgb(0, 0, 153); text-decoration: none; "&gt;NCBI Blast&lt;/a&gt;.&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&amp;nbsp;&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;b&gt;createJob&amp;nbsp;&lt;/b&gt;creates a temporary file with the content &amp;quot;0&amp;quot;. Filename retuirned as a &amp;quot;&lt;i&gt;job ID&lt;/i&gt;&amp;quot;.&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&amp;nbsp;&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;b&gt;checkStatus&amp;nbsp;&lt;/b&gt;reads the job, and return state &amp;quot;&lt;i&gt;RUNNING&lt;/i&gt;&amp;quot; as long as the content is less than 10, increasing the number for each call. (As no actual job is being run)&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&amp;nbsp;&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;b&gt;getResults&lt;/b&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;reads the file content, with the condition 'Run after checkStatus'.&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&amp;nbsp;&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;In&amp;nbsp;&lt;i&gt;Details-&amp;gt;Advanced&lt;/i&gt;&amp;nbsp;for&amp;nbsp;&lt;i&gt;checkStatus&amp;nbsp;&lt;/i&gt;you can check the loop condition, which says it will loop as long as the output '&lt;i&gt;state&lt;/i&gt;' is equal to '&lt;i&gt;RUNNING&lt;/i&gt;' - with a 0.5s delay.&amp;nbsp;&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&amp;nbsp;&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Thus when executing this workflow, checkStatus will be called repeatedly, and finally the 'result' should be '10' and '&lt;i&gt;state&lt;/i&gt;' should be '&lt;i&gt;COMPLETE&lt;/i&gt;'.&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&amp;nbsp;&lt;/div&gt;&#13;
&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;See&amp;nbsp;&lt;a href="http://www.mygrid.org.uk/dev/wiki/display/scrap/Looping+in+Taverna+2.1" rel="nofollow" style="color: rgb(0, 0, 153); text-decoration: none; "&gt;http://www.mygrid.org.uk/dev/wiki/display/scrap/Looping+in+Taverna+2.1&lt;/a&gt;&amp;nbsp;for details&lt;/div&gt;&#13;
&lt;/span&gt;&lt;/p&gt;</description>
  <type uri="http://www.myexperiment.org/type.xml?id=2" resource="http://www.myexperiment.org/content_types/2">Taverna 2</type>
  <uploader resource="http://www.myexperiment.org/users/5" uri="http://www.myexperiment.org/user.xml?id=5">Stian Soiland-Reyes</uploader>
  <created-at>Wed Jan 27 15:52:50 UTC 2010</created-at>
  <preview>http://www.myexperiment.org/workflows/1028/versions/2/previews/full</preview>
  <svg>http://www.myexperiment.org/workflows/1028/versions/2/previews/svg</svg>
  <license-type uri="http://www.myexperiment.org/license.xml?id=3" resource="http://www.myexperiment.org/licenses/3">by</license-type>
  <content-uri>http://www.myexperiment.org/workflows/1028/download/dummy_example_of_looping_592946.t2flow</content-uri>
  <content-type>application/vnd.taverna.t2flow+xml</content-type>
  <tags>
    <tag uri="http://www.myexperiment.org/tag.xml?id=609" resource="http://www.myexperiment.org/tags/609">beanshell</tag>
    <tag uri="http://www.myexperiment.org/tag.xml?id=733" resource="http://www.myexperiment.org/tags/733">condition</tag>
    <tag uri="http://www.myexperiment.org/tag.xml?id=1276" resource="http://www.myexperiment.org/tags/1276">looping</tag>
    <tag uri="http://www.myexperiment.org/tag.xml?id=1052" resource="http://www.myexperiment.org/tags/1052">loop</tag>
    <tag uri="http://www.myexperiment.org/tag.xml?id=1759" resource="http://www.myexperiment.org/tags/1759">dummy</tag>
    <tag uri="http://www.myexperiment.org/tag.xml?id=555" resource="http://www.myexperiment.org/tags/555">example</tag>
  </tags>
</workflow>

