<data name='outfile2' format='txt'>
<filter>two_outfiles == True</filter>
</data>
Let us know if this doesn't work for you or if you have further questions.
Thanks,
Dan
On Mar 9, 2010, at 1:08 AM, Edward Kirton wrote:
Hello,
Thanks for your help. While I have conditionals and filters working now, I've noticed the filter doesn't seem to work with the Boolean type. The workaround is simply changing the offending field to a Select type.
test tool config:
<tool id='output_filter_test' name='output filter test'>
<description>test</description>
<command interpreter='perl'>test.pl $two_outfiles $outfile1 $outfile2</command>
<inputs>
<param name='two_outfiles' type='boolean' truevalue='1' falsevalue='0' checked='true' label='Want second file'/>
</inputs>
<outputs>
<data name='outfile1' format='txt'/>
<data name='outfile2' format='txt'>
<filter>two_outfiles == '1'</filter>
</data>
</outputs>
<help>
Test script.
</help>
</tool>
it refers to this simple perl script:
#!/jgi/tools/bin/perl
die("Expected 3 args") unless @ARGV == 3;
my ($two_files, $outfile1, $outfile2) = @ARGV;
open(OUT, ">$outfile1") or die($!);
print OUT "this is outfile 1\n";
close OUT;
if ($two_files) {
open(OUT, ">$outfile2") or die($!);
print OUT "this is outfile 2\n";
close OUT;
}
exit 0;