Streamline document automation with XML job definitions

Job Definition Creation and Processing

Document Automation Server (DAS) Job Definitions are stored as XML files which are generated using the DAS Administrator.

A job definition file contains certain standard pieces of information (source folder for example) that are common to all jobs. See the Step Type for details on each step in the job.

It is these step definitions that are executed via the DAS service.

Job IDs

DAS uses a sequential integer job id that starts at 1001. The “next job id” value is held in the <Autobahn DX Installation folder\>\temp\next_job_id.xml file and is updated each time a new job is created or copied using the administration tool.

The initial contents of the file are:

<?xml version="1.0" encoding="ISO8859-1" ?>
<next_job_id>1001</next_job_id>

Sample job definition file

Below is a simple example of a job definition which is designed to continuously (every 30 seconds) monitor a directory (c:\faxes) for new .TIFF files and convert them to searchable PDF and place the resulting files in c:\processed faxes. The step details have been removed for clarity and are covered under a separate section - Step Details.

<autobahnjob>
<jobid>1009</jobid>
<jobname>Monitor incoming faxes and OCR them</jobname>
<adxversion>6.0</adxversion>
<trigger />
<scheduletype>continuous</scheduletype>
<scheduleevery>30</scheduleevery>
<scheduleeveryunits>Seconds</scheduleeveryunits>
<schedulefrom>00:00:00</schedulefrom>
<scheduleto>23:55:00</scheduleto>
<scheduleat>16:00:00</scheduleat>
<stopprocessingonerror>True</stopprocessingonerror>
<sendemailalerts>False</sendemailalerts>
<attachjobreport>False</attachjobreport>
<attachlogfile>False</attachlogfile>
<dontsendnoerror>False</dontsendnoerror>
<dontsendnofiles>False</dontsendnofiles>
<dontsendonsuccess>False</dontsendonsuccess>
<SendEmailAlertsfromaddress />
<SendEmailAlertstoaddress />
<skipprocessedfiles>False</skipprocessedfiles>
<skipmask>%FILENAME.pdf</skipmask>
<SendEmailAlertstitle>%JOBNAME% %JOBSTATUS%!</SendEmailAlertstitle>
<SendEmailAlertsmessage>Job: '%JOBNAME%' Status: '%JOBSTATUS%'.&lt;br&gt;
Log: %LOGFILE%.&lt;br&gt;Time: %DATESTAMP% %TIMESTAMP%&lt;br&gt;
Source: &lt;a href='%JOBSOURCE%'&gt;%JOBSOURCE%&lt;/a&gt;&lt;br&gt;
Target: &lt;a href='%JOBTARGET%'&gt;%JOBTARGET%&lt;/a&gt;&lt;br&gt;
</SendEmailAlertsmessage>
<jobprogresscsv>C:\Aquaforest\Autobahn DX\work\1009\JobProgress.csv</jobprogresscsv>
<jobsteps>1</jobsteps>
<joblogrention />
<joblogmaxsize />
<jobsourcetype>folder</jobsourcetype>
<jobsource>C:\Faxes</jobsource>
<jobtarget>C:\Processed Faxes</jobtarget>
<jobwork>C:\Aquaforest\Autobahn DX\work\1009</jobwork>
<jobarchive>C:\Aquaforest\Autobahn DX\work\Archive\1009</jobarchive>
<inputfilesrename>%FILENAME%%TIMESTAMP%.%EXT%</inputfilesrename>
<joberrors>C:\Aquaforest\Autobahn DX\work\1009\errors</joberrors>
<joblogfile>C:\Aquaforest\Autobahn DX\logs\1009\%DATESTAMP%.txt</joblogfile>
<jobCSVlogfile>C:\Aquaforest\Autobahn DX\logs\1009\%DATESTAMP%.csv</jobCSVlogfile>
<jobtemp>C:\Aquaforest\Autobahn DX\work\1009\temp</jobtemp>
<JobUseWorkFolder>False</JobUseWorkFolder>
<DeleteEmptyFolders>False</DeleteEmptyFolders>
<SkipErrorFolder>False</SkipErrorFolder>
<inputfileprocessing>leave</inputfileprocessing>
<jobfilterfile>include</jobfilterfile>
<jobfiltertype />
<jobfileorder>alphabetical</jobfileorder>
<jobreturnstructure>False</jobreturnstructure>
<filelength>False</filelength>
<jobinerror>Copy to Error Folder</jobinerror>
<jobstep>
...
</jobstep>
</autobahnjob>
XML ElementDescription
jobidThe job ID number (see Job ID section above).
jobnameJob Description. Default is “Job %JOBID%
adxversionDAS version
triggerName of the trigger file. The job will not start automatically until the trigger file is in the input folder.
scheduletype- Ad-hoc
- Continuous
- Onceperday
scheduleeveryFor continuous schedule type, interval between runs.
scheduleeveryunitsFor the continuous schedule type, unit of the interval between runs.
schedulefromFor continuous, start time for runs.
scheduletoFor onceperday, the time at which to run.
scheduleatFor continuous, end time for runs.
stopprocessingonerrorIf true, stop processing if an error occurs.
sendemailalertsIf true, send an email alert.
attachjobreportAttach the job report to the email.
attachlogfileAttach the log file to the email.
dontsendnoerrorIf no errors, do not send email.
dontsendnofilesIf no files are processed, do not send email.
dontsendonsuccessOn success, do not send email.
SendEmailAlertfromaddressAddress of sender.
SendEmailAlerttoaddressAddress of recipient.
skipprocessedfilesSkip files.
skipmaskMask of processed files to skip.
SendEmailAlertstitleTitle of email.
SendEmailAlertsmessageEmail body (HTML elements need to be escaped).
jobprogresscsvThe location of the temporary progress file used to store status information while the job is running.
joblogfileLocation of the job log file. By default, the log file is logs /%JOBID%/%TIMESTAMP%.txt
jobstepsThe number of job steps.
joblogrentionLog file retention period (days).
joblogmaxsizeMaximum log file size.
jobsourcetypeFile, folder or tree.
jobsourceThe source file or folder.
jobtargetThe target folder.
JoberrorsFolder for job errors. If not specified files that cannot be processed will be placed in jobwork/errors (this is also the default).
jobdeleteonsuccessIf “yes”, when a job has successfully completed, all work files (hence input files) are deleted.
jobworkThe root of the temporary work directories used by the job. The work directories themselves are named work1, work2 etc.
jobarchiveThe path of the folder used as the archive location when inputfileprocessing is set to move or copy to archive.
inputfilesrenameName template to rename input files after processing.
joblogfileThe log file filepath template, default is to name the log file as the current date.
jobCSVlogfileThe CSV log file filepath template, default is to name the log file as the current date.
jobtempThe temporary folder path.
JobUseWorkFolderUse intermediate work folders – required if the job has multiple steps or the input and output folder are the same.
DeleteEmptyFoldersIf true, delete any empty folders in the job source folder.
SkipErrorFolderIf true, inaccessible folders will be skipped without throwing an error.
inputfileprocessingAction on input files:
- Copy to Archive after processing
- Move to Archive after processing
- Leave input files after processing
- Move input files to Target folder after processing
- Delete input files
jobfilterfileFilter files based on:
- Include files matching
- Exclude files matching
- Include with document count limit
- Include unprocessed PDFs only
- Include unprocessed PDFs only with document count limit
jobfiltertypeFile filter.
jobfilterorderOrdering of files included (mainly used in conjunction with document count limit options):
- Alphabetical
- Created date/UTC date ascending or descending
- Modified date/UTC date ascending or descending.
jobreturnstructureIf true, the input folder structure will be preserved in the output.
filelengthIf true, skip long file names.
jobinerrorAction when job is in error:
- Move to error
- Copy to error
- Take no action.
jobstepContains the definition of a job step. Multiple elements, including multiple steps. See Sample Step Details.

Job step

The following is a sample job step. Other step types may have more step details and attribute vales.

<jobstep>
<stepsequence>1</stepsequence>
<steptype>kingfisher</steptype>
<stepdetails>
<operation>kingfisher</operation>
<sourcetype>folder</sourcetype>
<source>C:\Aquaforest\Autobahn DX\work\1010\work1\In</source>
<target>C:\Aquaforest\Autobahn DX\work\1010\work2\In</target>
<inerror>Copy to Error Folder</inerror>
<returnstructure>False</returnstructure>
<errors>C:\Aquaforest\Autobahn DX\work\1010\errors</errors>
<tempfolder>C:\Aquaforest\Autobahn DX\work\1010\temp</tempfolder>
<joboptions />
<advancedflags />
<fileorder>alphabetical</fileorder>
<kfjobid>10002</kfjobid>
<docoptions />
<logfile />
</stepdetails>
<attributevalues>
<attribute>
<attributeid>topdf2</attributeid>
<currentvalue />
</attribute>
<attribute>
<attributeid>topdf1</attributeid>
<currentvalue>10002</currentvalue>
</attribute>
</attributevalues>
</jobstep>
XML ElementsDescription
stepsequenceThe number of the step in the sequence. The steps will be processed in stepsequence order (ascending).
steptypeIdentifier of the step type. This will match the files (without the ordering number) found in <installation folder\>\Autobahn DX\steptype
stepdetailsDetails of the step that are passed to the step processor. See Step Details for more information.
attributevaluesElements that are displayed in the UI. See Attribute Values for more information.

A Job step comprises of four elements.

Step details

The details of the step are provided here and provide sufficient information for the DAS service to execute the step, in conjunction with the information in the StepType definitions. Files are moved from the jobsource directory into the working directory specified by <sourcefiles> and the result files are placed in the <target> directory. Upon completion of all the steps, the service will move the files from the final work directory to the <jobtarget> directory.

The Step Details will vary by step type.

XML ElementDescription
OperationThe operation (For example, split). This is defined in the step definition file for the steptype.
SourcetypeFolder, file or tree.
SourceSource file or folder.
TargetTarget folder.
inerrorAction to be undertaken in the event of an error.
returnstructureRetain file structure when copying/moving to error folder (based on inerror setting above).
ErrorsFiles that cannot be processed are placed in this directory. Inherited from the Job definition.
tempfolderThe temporary folder to use for this step (defaults to job temp folder).
JoboptionsThese are steptype-specific parameters that are derived from the options selected in the Job Designer.
advanced FlagsAdditional advanced steptype-specific parameters that can be entered manually only.
fileorderOrder of file selection.
kfjobidDocument Automation Server Content Extraction (Kingfisher) job id. This is linked to the attribute topdf2 (see below).
DocoptionsPDF file open options derived from the options selected in the Job Designer.
LogfileIf specified, the output will be logged to a file with this name in %PDFJUNCTIONDIR%\logs or %TIFFJUNCTIONDIR%\logs.

Attribute values

The attribute values element contains the attributes that are displayed and edited in the UI.

Each attribute element comprises paired attributeid and currentvalue elements.

The attributeid can be used to link to the matching stepdetail by examining the Step Type file.