<?xml version="1.0" ?>
<?xml:stylesheet type="text/xsl" href="http://twiki.mygrid.info/twiki/pub/Mygrid/WorkflowResources/sumwsfl.xsl"?>
<!--
  Copyright 2003 The Victoria University of Manchester
  Copyright 2003 University of Southampton IT Innovation Centre

  This file is part of myGrid.	Further information, and the
  latest version, can be found at http://www.mygrid.info

  myGrid is free software; you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation; either version 2.1
  of the License, or (at your option) any later version.

  myGrid is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
  GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with myGrid; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307	USA

  Created By:	       Mark Greenwood
  Created Date:        2003/03/20

  Dependencies:

  Last commit info:   To be completed

-->

<!-- 12.9.2002 testing soaplab derived web service
     20.03.2003 - test blastn  - ontology type may not be correct
 -->

<flowModel name="emboss_blastn" serviceProviderType="http://www.aboutmygrid.org/ontology#TBC string" logProvenance="true">

<serviceProvider name="soaplab_blastn_ncbi" type="soaplab_blastn_ncbi_derived">
    <locator type="static" service="http://industry.ebi.ac.uk/soaplab/wsdl/alignment__blastn_ncbi__derived.wsdl"/>
</serviceProvider>

<activity name="Create_activity">
   <performedBy serviceProvider="soaplab_blastn_ncbi"/>
   <implement>
      <export>
	  <target portType="alignment__blastn_ncbi" operation="createEmptyJob"/>
      </export>
   </implement>
</activity>
<!-- takes void and returns jobId -->

<activity name="Set_activity_a">
   <performedBy serviceProvider="soaplab_blastn_ncbi"/>
   <implement>
      <export>
	  <target portType="alignment__blastn_ncbi" operation="set_query_sequence"/>
      </export>
   </implement>
</activity>
<!-- takes jobId and string and returns void -->

<activity name="Set_activity_b">
   <performedBy serviceProvider="soaplab_blastn_ncbi"/>
   <implement>
      <export>
	  <target portType="alignment__blastn_ncbi" operation="set_database"/>
      </export>
   </implement>
</activity>
<!-- takes jobId and string and returns void -->

<activity name="Run_activity">
   <performedBy serviceProvider="soaplab_blastn_ncbi"/>
   <implement>
      <export>
	  <target portType="alignment__blastn_ncbi" operation="run"/>
      </export>
   </implement>
</activity>
<!-- takes jobId and returns void -->

<activity name="WaitFor_activity">
   <performedBy serviceProvider="soaplab_blastn_ncbi"/>
   <implement>
      <export>
	  <target portType="alignment__blastn_ncbi" operation="waitFor"/>
      </export>
   </implement>
</activity>
<!-- takes jobId and returns void -->

<activity name="Get_activity">
   <performedBy serviceProvider="soaplab_blastn_ncbi"/>
   <implement>
      <export>
	  <target portType="alignment__blastn_ncbi" operation="get_search_result"/>
      </export>
   </implement>
</activity>
<!-- takes jobId and returns results as a Map -->

<activity name="Destroy_activity">
   <performedBy serviceProvider="soaplab_blastn_ncbi"/>
   <implement>
      <export>
	  <target portType="alignment__blastn_ncbi" operation="destroy"/>
      </export>
   </implement>
</activity>
<!-- probably not essential but tidies things up -->

<dataLink source="Create_activity" target="Set_activity_a">
    <map sourceMessage="createEmptyJobResponse" targetMessage="set_query_sequenceRequest">
	<partMap source="return" target="jobId"/>
    </map>
</dataLink>

<dataLink source="Create_activity" target="Set_activity_b">
    <map sourceMessage="createEmptyJobResponse" targetMessage="set_databaseRequest">
	<partMap source="return" target="jobId"/>
    </map>
</dataLink>

<dataLink source="flowSource" target="Set_activity_a">
    <map sourceMessage="null" targetMessage="set_query_sequenceRequest">
	<partMap source="sequence" target="value"/>
    </map>
</dataLink>

<dataLink source="flowSource" target="Set_activity_b">
    <map sourceMessage="null" targetMessage="set_databaseRequest">
	<partMap source="database" target="value"/>
    </map>
</dataLink>

<dataLink source="Create_activity" target="Run_activity">
    <map sourceMessage="createEmptyJobResponse" targetMessage="runRequest">
	<partMap source="return" target="in0"/>
    </map>
</dataLink>

<dataLink source="Create_activity" target="WaitFor_activity">
    <map sourceMessage="createEmptyJobResponse" targetMessage="waitForRequest">
	<partMap source="return" target="in0"/>
    </map> 
</dataLink>

<dataLink source="Create_activity" target="Get_activity">
    <map sourceMessage="createEmptyJobResponse" targetMessage="get_search_resultRequest">
	<partMap source="return" target="jobId"/>
    </map>
</dataLink>

<dataLink source="Get_activity" target="flowSink">
    <map sourceMessage="get_search_resultResponse" targetMessage="null">
	<partMap source="return" target="WFResult_String"/>
    </map> 
</dataLink>

<dataLink source="Create_activity" target="Destroy_activity">
    <map sourceMessage="createEmptyJobResponse" targetMessage="destroyRequest">
	<partMap source="return" target="in0"/>
    </map>
</dataLink>

<controlLink source="flowSource" target="Create_activity"/>

<controlLink source="Set_activity_a" target="Run_activity" />
<controlLink source="Set_activity_b" target="Run_activity" />

<controlLink source="Run_activity" target="WaitFor_activity" />

<controlLink source="WaitFor_activity" target="Get_activity" />

<controlLink source="Get_activity" target="Destroy_activity" />

</flowModel>
