...foreach my $task_file (@task_files){ if( $task_file is template generated page ) { find $dcr for $task_file check for special conditions, locks, other dependencies, etc. (if any) delete $dcr, $task_file from workarea attach (deleted) $dcr, $task_file to workflow}...callback if no errors.