Forward port removing workflow instances that don't have an underlying workflow anymore.
This commit is contained in:
parent
fb3c85fdd2
commit
70b0c262f5
2 changed files with 15 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ my $quiet; # this line required
|
|||
|
||||
my $session = start(); # this line required
|
||||
hideGalleryAlbums($session);
|
||||
removeBrokenWorkflowInstances($session);
|
||||
|
||||
# upgrade functions go here
|
||||
|
||||
|
|
@ -58,6 +59,19 @@ sub hideGalleryAlbums {
|
|||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub removeBrokenWorkflowInstances {
|
||||
my $session = shift;
|
||||
print "\tRemove Workflow Instances whose Workflows have been deleted... " unless $quiet;
|
||||
# and here's our code
|
||||
my $instances = WebGUI::Workflow::Instance->getAllInstances($session);
|
||||
foreach my $instance (@{ $instances }) {
|
||||
my $workflow = $instance->getWorkflow;
|
||||
$instance->delete('skipNotify') if !defined $workflow;
|
||||
}
|
||||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue