Commit a9f7f07f authored by Jessica Severin's avatar Jessica Severin
Browse files

added method check_blocking_control_rules which checks all 'BLOCKED'

analyses by fetching all the control rules and checking the distributed
conditions that they are all 'DONE'
parent b5bc4739
......@@ -277,6 +277,33 @@ sub next_clutch {
}
sub check_blocking_control_rules
{
my $self = shift;
my $analysisStatsList = $self->db->get_AnalysisStatsAdaptor->fetch_by_status('BLOCKED');
foreach my $stats (@{$analysisStatsList}) {
#print("BLOCKED analysis "); $stats->print_stats;
my $ctrlRules = $self->db->get_AnalysisCtrlRuleAdaptor->
fetch_by_ctrled_analysis_id($stats->analysis_id);
my $allRulesDone = 1;
foreach my $ctrlrule (@{$ctrlRules}) {
#use this method because the condition_analysis objects can be
#network distributed to a different database so use it's adaptor to get
#the AnalysisStats object
my $condStats = $ctrlrule->condition_analysis->stats;
$allRulesDone = 0 unless($condStats->status eq 'DONE');
#print(" "); $condStats->print_stats;
}
if($allRulesDone and @{$ctrlRules}) {
#print(" UNBLOCK analysis : all conditions met\n");
$stats->adaptor->update_status($stats->analysis_id, 'READY');
}
}
}
......
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