Check that the Purge workflow exists before trying to run it. Fixes bug #11698

This commit is contained in:
Colin Kuskie 2010-07-01 11:08:44 -07:00
parent db96547f3c
commit 61008c8bb8
2 changed files with 11 additions and 5 deletions

View file

@ -298,11 +298,16 @@ sub _invokeWorkflowOnExportedFiles {
if ($workflowId) {
my ($lastExportedAs) = $self->get("lastExportedAs");
my $wfInstance = WebGUI::Workflow::Instance->create($self->session, { workflowId => $workflowId });
$wfInstance->setScratch(
WebGUI::Workflow::Activity::DeleteExportedFiles::DELETE_FILES_SCRATCH() =>
Storable::freeze([ defined($lastExportedAs) ? ($lastExportedAs) : () ])
);
$wfInstance->start(1);
if ($wfInstance) {
$wfInstance->setScratch(
WebGUI::Workflow::Activity::DeleteExportedFiles::DELETE_FILES_SCRATCH() =>
Storable::freeze([ defined($lastExportedAs) ? ($lastExportedAs) : () ])
);
$wfInstance->start(1);
}
else {
$self->session->log->warn('The Purge Workflow from the settings has been deleted and cannot be run.');
}
}
}