Unattended Processing

From Simple Wiki

Introduction[edit | edit source]

Any job configured to run as a pre-indexed batch can be run as an automatic background tasks using the SimpleIndex server. New batches are created automatically when files are saved to the Input folder. This can operate as a completely automated system, or as one step in a multi-step workflow.

Using an unattended process has many advantages. The biggest advantage is that nobody needs to manually initiate each new batch job or wait while large OCR jobs to run on their desktop. Anyone can submit files for processing from their desktop or network scanners without installing SimpleIndex or other special software.

If OCR results need to be validated, those users only need an inexpensive Standard license. Files output by the server can be added to validation queues where multiple users can review the documents and fill in any missing data.

Job Scheduler[edit | edit source]

Viewer Command Line Execution Unattended Processing Schedule Job Configuration Service Options
Unattended Processing Configuration

SimpleIndex can be configured for unattended processing using several methods. To access scheduled processing options, open the configuration file you want to schedule and click the Schedule Job option from the File menu. The dialog shown here are displayed.

Run Jobs on a Timer[edit | edit source]

This option lets you keep SimpleIndex open on the desktop and have process the job on a regular interval. Indicate how often you would like the job to run using the Timer Interval and click Run to begin automatic processing. SimpleIndex will continue to process the job on the selected interval until the user clicks the Cancel button. You can also select Stop when input folder is empty to end automatic processing as soon as all files have been processed.

Run Jobs with Windows Task Scheduler[edit | edit source]

You can use the Windows Task Scheduler to automatically launch SimpleIndex and run a job at a particular date in the future or to run it on an interval. Using the Task Scheduler only requires a server license if you enable Run whether user is logged in or not option. This means that a user must be logged on to the computer for the job to run without a Server license. Processing will stop if the user logs off or the computer is rebooted.

To configure a scheduled task, select a start date and time and click Schedule. You may optionally indicate a user account and password to run the task if the logged on user has insufficient rights.

Click Edit Tasks to open the Windows Task Scheduler. From here you can enable or disable specific jobs, or configure detailed settings.

Run Jobs as a Windows Service[edit | edit source]

To configure jobs to run as a Windows service, click the Configure Service Options button from the job scheduler window, or launch the Configure SimpleIndex Service application from the Start menu.

Viewer Run Jobs As A Windows Service Configuration Installation Controls Options
Configure SimpleIndex Service App

The Server license enables you run SimpleIndex as a Windows Service. This enables fully unattended processing for high-demand, server environments. Advantages to running as a Windows service include:

  • User does not have to be logged on for process to run
  • All dialog boxes are suppressed
  • Errors are logged to the Windows Application Log
  • Processing runs faster when application is hidden
  • Services can be started and stopped remotely

Service Installation[edit | edit source]

Viewer Run Jobs As A Windows Service Service Installation
Service Installation

The SimpleIndex service must first be installed before it can be configured. The service must run under a user account that has modify access rights to all folders and files used by the job. When all files are stored on the same computer, the System account is recommended. When files are stored on a network server, you must select a user account that has sufficient network permissions to access these files. Under the Service Account drop-down, select System or User as needed then click the Install Service button on the right to create the service.

When you click Install Service, you will be prompted to select the startup type (Manual or Automatic) and the user account (if User is selected).

After the service is installed, you can delete the service and all associated settings using the Delete Service button.

Once all service options have been configured, you can use the Start and Stop buttons to control service execution. You may also edit detailed service parameters using the Services management tool.

Job Configuration Files List[edit | edit source]

Manage the job files scheduled for processing here. If you have more than ~5 job files to run unattended, you can use the Document Classification Post-Process option to create a single job file you can schedule that will execute any job with new files to process automatically.

Adding and Removing Jobs[edit | edit source]

Once the service is installed you must add the job files that you want to run to the list using the Add Job button. Only Pre-Indexed jobs can be run as a service--if the job is not configured properly for unattended processing, you will receive a warning when you try to add it.

Each job file name must be unique. It is possible to have multiple threads for the same job if you create copies of the job file and add each one to the list. This improves throughput by utilizing multiple CPU cores simultaneously.

Jobs that run more often than hourly will stay running and check for new files every X minutes. Only one job can run like this at a time. To schedule multiple jobs, each should be set to run less frequently than once per hour.

To remove a job from the list, select the job and click the Remove button. This will delete all scheduling settings for that job from the registry.

Running Multiple Jobs from a Folder[edit | edit source]

The recommended method for running multiple jobs is to place all of the jobs in a common folder, and add that folder to the service job list. When you select a file for processing, it will prompt "Process all files in folder?" Selecting Yes will create a "hotfolder" that runs all of the jobs in that folder on the same schedule.

Each time the job timer elapses, the following will happen:

  1. The service will check the Job Folder for any job files (*.sic) that are configured with the Pre-Index option.
  2. The service will check the Input folder for each job file to see if there are any files to process
  3. If there are files in the Input folder, the service will run the corresponding job file
  4. After all jobs with files to process have been executed, the process will start again at the next interval

This is very useful for implementations that have many different types of documents to process. It minimizes the processing load and turnaround times by only running the job when there are files to process instead of loading the full processing engine just to check an empty folder.

Monitoring Job Progress[edit | edit source]

When the service is running, the Job Configuration Files list displays information about the status of each job.

  • Status

The current start/stop status of the service job. One of the following:

Scheduled: job is started and set to run at a future time.
Pending: timed job is awaiting next interval to start processing thread.
Paused: job is currently paused and will not run.
Running: processing thread is currently running.
Stopping: stop request has been received but a batch process is finishing.

  • Path

The path to the job file.

  • Step

The current processing step for the batch in progress. These correspond to the processing steps when you run the job interactively. Possible values:

Startup
PreProcess
Import
Processing
Export
Imprint
PostProcess
Complete

  • Last Batch

The Batch ID for the last job to process.

  • Last Run

The last date/time that a new process was started. For scheduled jobs this will indicate the time of the last batch process. For timer jobs this is the last time the processing thread was restarted.

  • PID

The Process ID for the processing thread for the current job. This field is blank if there is no active process. When you view the list of running processes in the Task Manager, the PID will let you figure out which process corresponds to the job.

Scheduling Jobs to Run[edit | edit source]

Viewer Running Scheduling Features Schedule Time To Run Jobs Function
Scheduling a Time to Run Jobs

Schedule a Time to Run[edit | edit source]

It is possible to run multiple jobs on different schedules. To configure the job schedule, select the job file from the list and the schedule for that job are displayed under Service Schedule.

Once the schedule has been set, click Save Changes to update the service controller. This will automatically restart the service.

Viewer Jobs Scheduling Run on a Timed Interval Feature Functions
Run on a Timed Interval Jobs Scheduling

Run on a Timed Interval[edit | edit source]

To run a job in a way that monitors a "hot folder" and processes new files as they appear, select Run on a Timed Interval. The Input folder for the job will be checked at the designated time interval in minutes or hours.

Advanced Service Options[edit | edit source]

Command Line Arguments - the SimpleIndex service works by launching a new SimpleIndex process for each job on its scheduled interval. Therefore it is possible to modify job parameters via the command line interface as part of the service configuration. The most common use for this is to enable the processing log with "/d". This will generate a detailed processing log that is very useful for diagnosing issues with unattended processes.

Viewer Windows Service Advanced Email Notifications System Option Features
Viewer Windows Advanced Email Notifications Services

Email Notifications - the SimpleIndex service can email an administrator whenever there is an error with one of the service jobs. To configure email notifications, click the Tools box at the bottom of the service configuration and select Email to display the email settings.

The email notification system uses SMTP to send messages. Enter the SMTP server, user, and password. Check Use SSL to encrypt the logon and prevent the password from being sent in plain text. Finally enter the To, From and Subject that will be used and click Add to save the settings, test and enable the email notifications.

Extended Logging - add items to the Application Log for any time a new process starts or stops, not just when an error occurs.

Web Service Interface[edit | edit source]

The web service interface lets you run specific jobs on the server on demand. The client application is able to send job file paths or URLs to the server and the server will immediately start processing that job.

The key advantages of using the web service interface are:

  • Run any job without having to configure and schedule it
  • Jobs run immediately instead of on a schedule
  • Tighter integration with custom applications
  • Lower overhead on the server when you have many possible job files

Installing the Web Service[edit | edit source]

On your web server, copy the WebJob.asmx file from your installation folder to a web-viewable folder on your web server. Note the resulting URL. For example, if your website is "www.mysite.com" and you place the file in a folder called "Service" the resulting URL would be:

http://www.mysite.com/Service/WebJob.asmx

This is the URL you need to enter in the next step.

Viewer Running Jobs Windows Services Web Service Interface Installation Thumbnail

Click the Add Web Service button in the service manager to enter the URL from the previous step. A dialog will note if the connection is successful or not.

Once a URL is entered, the service will connect to the web service and listen for jobs automatically when it is started. To disable the web service, simply enter a blank for the URL.

Using the Web Service Sample Client[edit | edit source]

A sample application is installed in the program folder called WebServiceClient.exe. This application can be used to connect to the web service and launch jobs on the server.

Viewer Running Jobs Window services web service Sample Client WebClient Configuration
Running Web Service Sample Client

Launch the application. Enter your Web Service URL for your server. You can then enter either the full path to a job file under Job File Path, or you can enter a valid command line that includes the job file as well as other parameters like Input or Output folders and index values. Click the Run Job button to send the job to the server for processing.

If multiple jobs have been queued for processing on the server, you can use the Update List button to see the list of pending jobs.

WebServiceClient.exe can be distributed by itself and run from any computer. The web service is designed to be integrated into your custom application but the sample application can be used if necessary.

Referencing the Web Service[edit | edit source]

As with any web service, you must first add a web service reference to your .NET project. Right-click your project and select Add Web Reference... (or Add Service Reference...) from the context menu. Enter the URL for your web service form.

Launching Jobs with the Web Service[edit | edit source]

Once you have added the reference to the web service, you can start new jobs on the server by calling the AddJob function.

AddJob takes two parameters. The Session ID is a GUID that uniquely identifies this application instance and allows multiple clients to communicate with the server. The second parameter is a Job File Path, which can be a URL, UNC path or local file path on the server. This must be a valid XML job file that is accessible by the server process.

C#
WebJob srvc = new WebJob();
Guid sessionID = Guid.NewGuid();
string JobFile = @"http://www.myserver.com/jobfile.sic";
srvc.AddJob(sessionID, JobFile);

VB.NET

Dim srvc as WebJob
Dim sessionID as Guid
sessionID = Guid.NewGuid()
Dim JobFile as string = @"http://www.myserver.com/jobfile.sic"
srvc.AddJob(sessionID, JobFile)

One Click Processing Video[edit | edit source]

Video was recorded in a previous version of SimpleIndex. Refer to the wiki documentation for latest updates.

Related Knowledge Base Articles[edit | edit source]