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

changed logic of check_blocking_control_rules so that if will re-BLOCK

an analysis if one of it's conditions are not fullfilled.  Needed for case
when system is done, and new data is flowed through the system (progressive runs).
parent f6e175a0
......@@ -327,26 +327,33 @@ sub check_blocking_control_rules
{
my $self = shift;
my $analysisStatsList = $self->db->get_AnalysisStatsAdaptor->fetch_by_status('BLOCKED');
my $analysisStatsList = $self->db->get_AnalysisStatsAdaptor->fetch_all();
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;
}
my $allRulesDone = 1;
if(scalar @$ctrlRules > 0) {
#print("HAS blocking_ctrl_rules to check\n");
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
#$ctrlrule->print_rule;
my $condAnalysis = $ctrlrule->condition_analysis;
my $condStats = $condAnalysis->stats if($condAnalysis);
$allRulesDone = 0 unless($condStats and $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');
if($allRulesDone) {
#print(" UNBLOCK analysis : all conditions met\n");
$stats->adaptor->update_status($stats->analysis_id, 'READY');
} else {
#print(" RE-BLOCK analysis : all conditions met\n");
$stats->adaptor->update_status($stats->analysis_id, 'BLOCKED');
}
}
}
}
......
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