Commit 0e34c22b authored by Jessica Severin's avatar Jessica Severin
Browse files

forgot to insert the branch_code in the store() method

parent 9754ee32
......@@ -86,15 +86,15 @@ sub store {
my $dataflow_rule_id;
my $sth = $self->prepare( q{INSERT ignore INTO dataflow_rule
SET from_analysis_id = ?, to_analysis_url = ? } );
if($sth->execute($rule->from_analysis_id, $rule->to_analysis_url)) {
SET from_analysis_id = ?, to_analysis_url = ?, branch_code=? } );
if($sth->execute($rule->from_analysis_id, $rule->to_analysis_url, $rule->branch_code)) {
$dataflow_rule_id = $sth->{'mysql_insertid'};
$sth->finish();
$rule->dbID($dataflow_rule_id);
#print(" stored with dbID = $dataflow_rule_id\n");
} else {
#print(" failed to execute -> already inserted -> need to get dbID\n");
$sth->finish();
$sth->finish();
$sth = $self->prepare(q{SELECT dataflow_rule_id FROM dataflow_rule WHERE
from_analysis_id = ? AND to_analysis_url = ? } );
$sth->execute($rule->from_analysis_id, $rule->to_analysis_url);
......@@ -130,6 +130,20 @@ sub remove {
$sth->execute;
}
sub create_rule {
my ($self, $fromAnalysis, $toAnalysis, $branchCode) = @_;
return unless($fromAnalysis and $toAnalysis);
my $rule = Bio::EnsEMBL::Hive::DataflowRule->new();
$rule->from_analysis($fromAnalysis);
$rule->to_analysis($toAnalysis);
$rule->branch_code($branchCode) if(defined($branchCode));
$self->store($rule);
}
############################
#
# INTERNAL METHODS
......
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