Skip to content

Commit

Permalink
Update gwendia-standalone.vm
Browse files Browse the repository at this point in the history
intelligence to put result dir in dot or cross
  • Loading branch information
sandepat authored Jul 1, 2024
1 parent 301a78b commit 72795d4
Showing 1 changed file with 85 additions and 73 deletions.
158 changes: 85 additions & 73 deletions vip-portal/src/main/resources/vm/gwendia-standalone.vm
Original file line number Diff line number Diff line change
Expand Up @@ -5,87 +5,99 @@
<source name="results-directory" type="URI" optional="false" default="/vip/Home" pretty-name="Results directory">
<source-comment>Directory where the results will be stored.</source-comment>
</source>
#foreach( $input in $tool.getInputs() )
#set($type="string")
#if($input.getType().getCamelName()=="File")
#set($type="URI")
#end
#if($input.getType().getCamelName()=="Flag")
#if($input.getDefaultValue() && $input.getDefaultValue()!="")
<source name="$input.getId()" type="string" optional="$input.isOptional()" default="$input.getDefaultValue()" vip-type-restriction="flag" pretty-name="$input.getName()">
#else
<source name="$input.getId()" type="string" optional="$input.isOptional()" default="false" vip-type-restriction="flag" pretty-name="$input.getName()">
#foreach( $input in $tool.getInputs() )
#set($type="string")
#if($input.getType().getCamelName()=="File")
#set($type="URI")
#end
#if($input.getType().getCamelName()=="Flag")
#if($input.getDefaultValue() && $input.getDefaultValue()!="")
<source name="$input.getId()" type="string" optional="$input.isOptional()" default="$input.getDefaultValue()" vip-type-restriction="flag" pretty-name="$input.getName()">
#else
<source name="$input.getId()" type="string" optional="$input.isOptional()" default="false" vip-type-restriction="flag" pretty-name="$input.getName()">
#end
#else
#if($input.getDefaultValue() && $input.getDefaultValue()!="")
#if($input.getType().getCamelName()=="Number" && $input.isInteger())
<source name="$input.getId()" type="$type" optional="$input.isOptional()" default="$input.getDefaultValue().intValue()" pretty-name="$input.getName()">
#else
<source name="$input.getId()" type="$type" optional="$input.isOptional()" default="$input.getDefaultValue()" pretty-name="$input.getName()">
#end
#else
#if($input.isOptional()==true)
<source name="$input.getId()" type="$type" optional="$input.isOptional()" default="No_value_provided" pretty-name="$input.getName()">
#else
<source name="$input.getId()" type="$type" optional="$input.isOptional()" pretty-name="$input.getName()">
#end
#end
#end
#if($input.getDescription())
<source-comment>$esc.xml($input.getDescription())</source-comment>
#else
<source-comment></source-comment>
#end
</source>
#end
#else
#if($input.getDefaultValue() && $input.getDefaultValue()!="")
#if($input.getType().getCamelName()=="Number" && $input.isInteger())
<source name="$input.getId()" type="$type" optional="$input.isOptional()" default="$input.getDefaultValue().intValue()" pretty-name="$input.getName()">
#else
<source name="$input.getId()" type="$type" optional="$input.isOptional()" default="$input.getDefaultValue()" pretty-name="$input.getName()">
#end
#else
#if($input.isOptional()==true)
<source name="$input.getId()" type="$type" optional="$input.isOptional()" default="No_value_provided" pretty-name="$input.getName()">
#else
<source name="$input.getId()" type="$type" optional="$input.isOptional()" pretty-name="$input.getName()">
#end
#foreach($output in $tool.getOutputFiles())
<sink name="$output.getId()" type="URI" />
#end
#end
#if($input.getDescription())
<source-comment>$esc.xml($input.getDescription())</source-comment>
#else
<source-comment></source-comment>
#end
</source>
#end
#foreach($output in $tool.getOutputFiles())
<sink name="$output.getId()" type="URI" />
#end
</interface>
<processors>
<processor name="append-date" >
<in name="dir" type="URI" depth="0" />
<out name="result" type="string" depth="0" />
<beanshell>/*----------Beginning of Beanshell------------*/
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
<beanshell>
/*----------Beginning of Beanshell------------*/
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

String result = dir.toString();
if ( result.startsWith("/") || result.startsWith("lfn:") ) {
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss");
result = result + "/" + (dateFormat.format(System.currentTimeMillis()));
}
/*------------End of Beanshell------------*/
String result = dir.toString();
if ( result.startsWith("/") || result.startsWith("lfn:") ) {
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy_HH:mm:ss");
result = result + "/" + (dateFormat.format(System.currentTimeMillis()));
}
/*------------End of Beanshell------------*/
</beanshell>
</processor>
<processor name="$tool.getName()" >
<in name="results-directory" type="string" depth="0"/>
#foreach($input in $tool.getInputs())
#if($input.getType().getCamelName()=="File" )
<in name="$input.getId()" type="URI" depth="0"/>
#else
<in name="$input.getId()" type="string" depth="0"/>
#end
#end
#foreach( $output in $tool.getOutputFiles() )
<out name="$output.getId()" type="URI" depth="0"/>
#end
#foreach($input in $tool.getInputs())
#if($input.getType().getCamelName()=="File" )
<in name="$input.getId()" type="URI" depth="0"/>
#else
<in name="$input.getId()" type="string" depth="0"/>
#end
#end
#foreach( $output in $tool.getOutputFiles() )
<out name="$output.getId()" type="URI" depth="0"/>
#end
<iterationstrategy>
<cross>
<port name="results-directory" />
#foreach($input in $tool.getInputs())
#if(!$tool.getVipDotInputIds().contains($input.getId()))
<port name="$input.getId()"/>
#end
#end
#if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty())
<dot>
#foreach($dotInput in $tool.getVipDotInputIds())
<port name="$dotInput"/>
#end
</dot>
#end
#if($tools.getVipDotResultDirs)
<dot>
<port name="results-directory" />
#foreach($input in $tool.getInputs())
#if($tool.getVipDotInputIds().contains($input.getId()))
<port name="$input.getId()"/>
#end
#end
</dot>
#else
<port name="results-directory" />
#foreach($input in $tool.getInputs())
#if(!$tool.getVipDotInputIds().contains($input.getId()))
<port name="$input.getId()"/>
#end
#end
#end
#if($tool.getVipDotInputIds() && !$tool.getVipDotInputIds().isEmpty() && !$tools.getVipDotResultDirs)
<dot>
#foreach($dotInput in $tool.getVipDotInputIds())
<port name="$dotInput"/>
#end
</dot>
#end
</cross>
</iterationstrategy>
<gasw descriptor="$fileAccessProtocol:$tool.getGASWLFN()"/>
Expand All @@ -94,11 +106,11 @@ if ( result.startsWith("/") || result.startsWith("lfn:") ) {
<links>
<link from="results-directory" to="append-date:dir" />
<link from="append-date:result" to="$tool.getName():results-directory" />
#foreach( $input in $tool.getInputs() )
<link from="$input.getId()" to="$tool.getName():$input.getId()" />
#end
#foreach($output in $tool.getOutputFiles())
<link from="$tool.getName():$output.getId()" to="$output.getId()" />
#end
#foreach( $input in $tool.getInputs() )
<link from="$input.getId()" to="$tool.getName():$input.getId()" />
#end
#foreach($output in $tool.getOutputFiles())
<link from="$tool.getName():$output.getId()" to="$output.getId()" />
#end
</links>
</workflow>

0 comments on commit 72795d4

Please sign in to comment.