local
This is the Blast sequence alignment workflow.
####
uplfile
####
package Upload_file;
use strict;
use Fcntl;
use base qw( Workflow::Action );
use Workflow::Exception qw( workflow_error );
sub new {
my $class = shift;
my $self = {};
bless ($self, $class);
return $self;
}
sub execute {
my ( $self, $wf ) = @_;
my $ifile = "/mypath/to/codelib/perl/lib/myapp/testseq.txt";
sysopen(IFILE, $ifile, O_RDONLY)
or die "Can't open $ifile : $!";
my @file = ;
close IFILE;
print "testseq is ", @file, "\n";
return 1;
}
1;
####
#! /bin/perl -w
use strict;
use Workflow::Factory qw( FACTORY );
use Fcntl;
use File::Basename;
Log::Log4perl::init('l4p.conf');
my $workflow_conf = 'wf_test.xml';
my $action_conf = 'action.xml';
my $pers = 'persister.xml';
FACTORY->add_config_from_file(
workflow => $workflow_conf,
action => $action_conf,
persister => $pers,
);
my $wf = FACTORY->fetch_workflow('uplfile', "PITGKDNR");
print "Workflow 1 ", $wf->id, " ",
"currently at state ", $wf->state, "\n";
print "Available actions: ", $wf->get_current_actions, "\n";
$wf->execute_action('upload file');
####
Workflow 1 PITGKDNR currently at state INITIAL
Available actions: upload file
Can't locate object method "new" via package "myapp::Upload_file" at /lib/x86_64/pkg/perl-5.8.8/lib/site_perl/5.8.8/Workflow/Factory.pm line 546.
####
Upload_file->new()->execute();