Wednesday, February 22, 2012

AutoDelete Batches with NENU

AutoDelete Batches with NENU


Abstract


As users process batches, the Taskmaster application’s “batches” folder can become very
large. For many applications, a batch loses much of its value after the Export task copies the
verified data to an export file or database in another location. If you wish, you can create a
NENU ruleset to periodically purge old batches from the application’s “batches” folder and
remove the corresponding records from the application’s engine database.

how to create an AutoDelete ruleset :
• Locate batches completed within a given timeframe (for example, more than five days
ago).
• Delete those batches from the application’s “batches” folder, or move them to an archive
folder.
• Delete the records relating to the deleted batches from the application’s engine database, or
move those records to a separate archive database.
• Generate a log file documenting the results of the process.
You can then schedule the AutoDelete ruleset to run automatically on a scheduled basis (for
more information, see Configure Windows Task Scheduler to Run Ruleset Automatically
(Windows 7, Windows 2008) and Configure Windows Task Scheduler to Run Ruleset
Automatically (Windows 2003)).
AutoDelete Process
When you run a batch through the application workflow, Taskmaster does the following:
• Updates the image files, page data, etc. in the application’s “batches” folder.
• Updates the batch status information in the application’s engine database
IBM Datacap Taskmaster Capture
Copyright © 1994, 2011 Datacap Inc. Page 209
In order to delete old batches from the system, you must remove the information from the
“batches” folder and the engine database. Typically you will move the data to a backup
location:
• You can move the batch folders to any available local drive or network share using the
ProcessMoveBatches action. For an example, see Sample AutoDelete Ruleset.
• You must move the database information to another database with the same format as the
engine database. The easiest way to create the database is to create another Taskmaster
application. You can then move the records use the ProcessMoveDBRecords action. For
an example, see Sample AutoDelete Ruleset.
Sample AutoDelete Ruleset
The sample ruleset found below removes all batches that were completed more than five days
ago (the age is specified in seconds). It uses a separate Taskmaster application called
“BackupApp” as an archive repository for the batches and database records that are removed
from the production application (“APT” in this example).
Each of the actions in the sample AutoDelete ruleset is described in the following table. For
more information, see the section titled Summary of NENU Actions or the embedded help in
Datacap Studio.

AutoDelete
Rule1
Function1
SetApplication(“APT”) ;                                                               ->    Set application to APT
SetUser(“admin”) ;                                                                          ->   Set username
SetPassword(“admin”) ;                                                                ->   Set password
SetStation(“1”) ;                                                                               ->    Set station
SetupOpenApplication() ;                                                            ->   Connect to APT application
QuerySetStatus(“Job done”) ;                                                    ->   Locate batches with status “Job done”
QuerySetAge(“432000”, False) ;                                              ->   Locate batches completed more than 5 days
ago (age is specified in seconds)
ProcessRunSQLQuery()                                                                ->   Execute query
ProcessMoveBatches(“G:\BackupApp\batches”) ;           ->  Move batch folders to backup location
ProcessMoveDBRecords(“BackupApp”, “”, “”,
“”, False, “admin”, “admin”, “1”, True);                                 ->   Move database records to backup application
database

 

1 comment:

  1. Hi When i used AutoDelete Ruleset in my application im getting following error:
    12:24:07.104 (63) t:1068 p:6A7CFA8 !!! ERROR !!!: Can't run SQL request:'Select * FROM JobMonitor WHERE qu_status IN ('aborted') AND qu_done >= '2013/02/07 12:14:07''. Database type:'Unknown', application:'APT', server:'tms',admin DB:'tmadmin', engine DB:'tmengine', user:'admin', station:'1'. Exception:'Root element is missing.'.

    The issue is happening only when i use QuerysetAge action otherwise its working fine.

    can i get help on this?

    ReplyDelete