<?xml version="1.0" encoding="UTF-8"?>
<s:scufl xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha" version="0.2" log="0">
  <s:workflowdescription lsid="urn:lsid:www.mygrid.org.uk:operation:9F0FD73EQF0" author="Ingo Wassink" title="A script calculating the mean and standard deviation of 100000 random values" />
  <s:processor name="GenerateList">
    <s:rshell s:hostname="localhost" s:port="6311" s:username="" s:password="" s:keepSessionAlive="true">
      randomList = rnorm(1:numberOfRandomValues)*100;
      <s:rshellInputPortList>
        <s:rshellInputPort s:syntacticType="'text/plain'" s:symanticType="INTEGER">numberOfRandomValues</s:rshellInputPort>
      </s:rshellInputPortList>
      <s:rshellOutputPortList>
        <s:rshellOutputPort s:syntacticType="l('text/plain')" s:symanticType="INTEGER_LIST">randomList</s:rshellOutputPort>
      </s:rshellOutputPortList>
    </s:rshell>
  </s:processor>
  <s:processor name="meanAndSD">
    <s:rshell s:hostname="localhost" s:port="6311" s:username="" s:password="" s:keepSessionAlive="true">
      meanValue &lt;- mean(randomList);
sdValue &lt;- sd(randomList);
      <s:rshellInputPortList />
      <s:rshellOutputPortList>
        <s:rshellOutputPort s:syntacticType="'text/plain'" s:symanticType="DOUBLE">meanValue</s:rshellOutputPort>
        <s:rshellOutputPort s:syntacticType="'text/plain'" s:symanticType="DOUBLE">sdValue</s:rshellOutputPort>
      </s:rshellOutputPortList>
    </s:rshell>
  </s:processor>
  <s:processor name="String_Constant" boring="true">
    <s:stringconstant>100000</s:stringconstant>
  </s:processor>
  <s:link source="String_Constant:value" sink="GenerateList:numberOfRandomValues" />
  <s:link source="meanAndSD:meanValue" sink="mean" />
  <s:link source="meanAndSD:sdValue" sink="sd" />
  <s:sink name="mean" />
  <s:sink name="sd" />
  <s:coordination name="RShell1_BLOCKON_GenerateList">
    <s:condition>
      <s:state>Completed</s:state>
      <s:target>GenerateList</s:target>
    </s:condition>
    <s:action>
      <s:target>meanAndSD</s:target>
      <s:statechange>
        <s:from>Scheduled</s:from>
        <s:to>Running</s:to>
      </s:statechange>
    </s:action>
  </s:coordination>
</s:scufl>


