Commit 27633e4a authored by Leo Gordon's avatar Leo Gordon
Browse files

moved autoflow where it belongs - into the AnalysisJob

parent 61ef5b2e
...@@ -139,6 +139,28 @@ sub stderr_file { ...@@ -139,6 +139,28 @@ sub stderr_file {
return $self->{'_stderr_file'}; return $self->{'_stderr_file'};
} }
=head2 autoflow
Title : autoflow
Function: Gets/sets flag for whether the job should
be automatically dataflowed on branch 1 when the job completes.
If the subclass manually sends a job along branch 1 with dataflow_output_id,
the autoflow will turn itself off.
Returns : boolean (1=default|0)
=cut
sub autoflow {
my $self = shift;
$self->{'_autoflow'} = shift if(@_);
$self->{'_autoflow'} = 1 unless(defined($self->{'_autoflow'}));
return $self->{'_autoflow'};
}
##-----------------[indicators to the Worker]-------------------------------- ##-----------------[indicators to the Worker]--------------------------------
......
...@@ -270,24 +270,6 @@ sub input_job { ...@@ -270,24 +270,6 @@ sub input_job {
return $self->{'_input_job'}; return $self->{'_input_job'};
} }
=head2 autoflow_inputjob
Title : autoflow_inputjob
Function: Gets/sets flag for whether the input_job should
be automatically dataflowed on branch code 1 when the
job completes. If the subclass manually sends a job along
branch 1 with dataflow_output_id, the autoflow will be turned off.
Returns : boolean (1/0/undef)
=cut
sub autoflow_inputjob {
my $self = shift;
$self->{'_autoflow_inputjob'} = shift if(@_);
$self->{'_autoflow_inputjob'}=1 unless(defined($self->{'_autoflow_inputjob'}));
return $self->{'_autoflow_inputjob'};
}
=head2 dataflow_output_id =head2 dataflow_output_id
Title : dataflow_output_id Title : dataflow_output_id
...@@ -323,7 +305,7 @@ sub dataflow_output_id { ...@@ -323,7 +305,7 @@ sub dataflow_output_id {
my $semaphored_job_id = $create_job_options->{'-semaphored_job_id'} ||= $self->input_job->semaphored_job_id(); my $semaphored_job_id = $create_job_options->{'-semaphored_job_id'} ||= $self->input_job->semaphored_job_id();
# if branch_code is set to 1 (explicitly or impliticly), turn off automatic dataflow: # if branch_code is set to 1 (explicitly or impliticly), turn off automatic dataflow:
$self->autoflow_inputjob(0) if($branch_code==1); $self->input_job->autoflow(0) if($branch_code==1);
my @output_job_ids = (); my @output_job_ids = ();
my $job_adaptor = $self->db->get_AnalysisJobAdaptor; my $job_adaptor = $self->db->get_AnalysisJobAdaptor;
......
...@@ -656,7 +656,7 @@ sub run_module_with_job { ...@@ -656,7 +656,7 @@ sub run_module_with_job {
$runObj->queen($self->queen); $runObj->queen($self->queen);
$runObj->worker($self); $runObj->worker($self);
$runObj->debug($self->debug); $runObj->debug($self->debug);
$runObj->autoflow_inputjob(1); $job->autoflow(1);
} else { } else {
$runObj->input_id($job->input_id); $runObj->input_id($job->input_id);
$runObj->db($self->db); $runObj->db($self->db);
...@@ -687,7 +687,7 @@ sub run_module_with_job { ...@@ -687,7 +687,7 @@ sub run_module_with_job {
$runObj->write_output; $runObj->write_output;
$self->{'writing_stopwatch'}->pause(); $self->{'writing_stopwatch'}->pause();
if( $native_hive_process and $runObj->autoflow_inputjob ) { if( $native_hive_process and $job->autoflow ) {
printf("AUTOFLOW input->output\n") if($self->debug); printf("AUTOFLOW input->output\n") if($self->debug);
$runObj->dataflow_output_id(); $runObj->dataflow_output_id();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment