Archiving Jobs

Overview

Laboratories process large numbers of jobs and samples from clients. Processing these samples in CCLAS EL ultimately leads to many jobs being kept live in the system. The large number of jobs in the system could potentially make the CCLAS EL unwieldy for users.

This process is pertinent to front office staff and LIMS administrators who archive jobs for job closure and system performance.

Process

Archiving of jobs is done as an extension to the Maintaining Jobs process, first by locating a job, then by selecting archiving flows. A user may only archive a job if the AllowJobArchive PROFILE program setting is enabled.

Jobs are archived either to a parallel (off-line) database, or to a ZIP file.

During the archiving process, it is possible to entirely remove a job from the live database. A user may only remove or delete a job if the AllowJobDelete PROFILE program setting is enabled.

Archiving to an Off-line Database

The ability to archive a job to an off-line database allows the live databases to be kept to a reasonable size, but provides users with easy access to the off-line data using existing CCLAS tools. The destination database is defined by the ArchiveDBDataSource, ArchiveDBProvider, ArchiveDBUser and ArchiveDBPassword GLOBAL settings.

The job is kept as an XML backup in the destination database. The following assumptions are made when archiving a job to another database:

  • Both the source and the destination databases are on the same LAN or WAN
  • Both the source and destination databases will have the same database structure
  • Referential integrity will not be enforced on the destination database. This allows for jobs to be happily transferred even though there may not be matching records in the SCHEME, SCHEME_ANALYTE, CLIENT, or other relating tables.

Off-line archiving includes all the PROFJOB tables and the AUDITJOB tables. Custom tables are included in the off-line job archive if they are specified by the ArchiveDBTablen GLOBAL settings.

This option is not available if the AllowOfflineArchive PROFILE program setting is disabled.

Archive a job to another database

Customising Off-line Job Archiving

Whenever off-line job archive is requested, where the ProUDF.VBS VBScript file is located in the folder defined by the ConfigDirectory GLOBAL setting, and the ArchiveDBCanBeArchived subroutine exists within the script file, then it is run to typically determine whether off-line job archive can proceed, and can cancel the off-line job archive, if required. Where the ArchiveDBBeforeInsert subroutine exists within the script, then it is run before records are inserted into the destination database. Where the ArchiveDBAfterInsert subroutine exists within the script, then it is run after the records are inserted into the destination database. Where the ArchiveDBBeforeDelete subroutine exists within the script, then it is run before records are deleted from the source database. Where the ArchiveDBAfterDelete subroutine exists in the script, then it is run after the records are deleted from the source database.

Archiving to a ZIP File

Jobs can also be archived to a ZIP file. This archive process involves creating XML backup files of the job. These files are then compressed into a ZIP file, named {Job}.ZIP. The ZIP files are located in a folder specified by the ArchiveDirectory GLOBAL setting.

This method of archiving jobs can be run interactively by the user or non-interactively via script. In interactive mode, archive to a ZIP file is triggered for a selected job via the Job application. The XML files that are created as part of the archive process are written to the folder specified by the ArchiveDBXMLFolder GLOBAL setting.

ZIP file archiving contains all the PROFJOB tables and any files from the IDENTS directory for the job. The only records containing information relating to the archived job are kept in the following CCLAS database tables: STJOB, STJOB_SAMPLE, STJOBAUDIT, STJOBAUDIT_SAMPLE, QCHISTORY, INVOICE_JOB and INVOICE_JOB_SCHEME. Custom tables are included in the ZIP file job archive if they are specified by the ArchiveCustomTablen GLOBAL settings.

This option is not available if the AllowJobArchive PROFILE program setting is disabled.

Archive a job to a ZIP file

Customising Zip File Archiving

Where the ProUDF.VBS VBScript file is located in the folder defined by the ConfigDirectory GLOBAL setting, then the subroutines within it are triggered at particular points during job archive to perform custom logic:

  • Where the ArchiveDBCanBeArchived subroutine exists within the script, when a job archive is requested, then it is run to determine whether job archive can proceed, and can cancel the job archive, if required.
  • Where the BeforeJobArchive subroutine exists within the script file, before a job is archived, then it is run to perform custom logic.
  • Where the ArchiveDBBeforeInsert subroutine exists within the script file, during job archive, then it is run to configure whether the job remains in the source database, whether the job is deleted from the destination if it already exists there, whether ident files are included in the archive, and whether PROFJOB, PROFJOBUSER and AUDITJOB records are kept in the source database.
  • Where the ArchiveDBBeforeDelete subroutine exists within the script file, during job archive, then it is run to configure whether the job remains in the source database, whether the job is deleted from the destination if it already exists there, whether ident files are included in the archive, and whether PROFJOB, PROFJOBUSER and AUDITJOB records are kept in the source database.
  • Where the DuringJobArchive subroutine exists within the script, during job archive, then it is run to typically add additional files to the ZIP file.
  • Where the AfterJobArchive subroutine exists within the script, after a job is archived, then it is run to perform custom logic.
Retrieving a Job from a ZIP File

Once a job is archived to a ZIP file, it can be retrieved, if required.

If the file name contains a comma and a job number after the ZIP file name, the data in the ZIP file is retrieved to the defined job.

Custom tables are included in the job retrieval if they are specified by the ArchiveCustomTablen GLOBAL settings.

Retrieve a job from a ZIP file

Customising Zip File Retrieval

Whenever ZIP job retrieval is requested, where the ProUDF.VBS VBScript file is located in the folder defined by the ConfigDirectory GLOBAL setting, and the BeforeJobRetrieve subroutine exists within the script file, then it is run to typically determine whether ZIP job retrieval can proceed, and can cancel the ZIP job retrieval, if required. Where the DuringJobRetrieve subroutine exists within the script, then it is run during the job retrieval, typically to add manage additional files in the ZIP file. Where the AfterJobRetrieve subroutine exists within the script, then it is run after the job retrieval.