Scheduling Background Tasks (Developer/Administrator)
The application runs reports as background tasks that are placed on
a "queue" to be run in order. You can also set up other tasks
to run in the background. The TaskMan Windows service polls the list of
Active Background Tasks and executes any new task that is posted to the
queue with a status of READY.
SQL Server Agent must be running on the database server in order to
perform background processing.
For more information about TaskMan, see the Infor SyteLine Administration Guide
or the Reporting
Guide.
Create a Background Task
- Create a new record on the Background
Task Definitions form.
- Specify a task name (for example, RunCustomerOrderReport) and description.
- Specify an executable:
- For a report, specify the name of the report (for example,
CustomerOrder) in the Executable Name field and the type of executable
(RPT) in the Executable Type field.
- For a stored procedure, specify the procedure name in the Executable
Name field and select SP in the Executable Type field.
- For an executable program, specify the program name and path
(for example, c:\Infor\myprog) in the Executable Name field and
select EXE in the Executable Type field.
- For an IDO method, specify the method name (in the format IDO.Method
- for example, MyProgID.SLSites.MyTestMethod) in the Executable
Name field and select IDOMTH in the Executable Type field.
- Click the buttons on the form to specify any report options or
excluded tasks.
- Save the record.
Your new background task can be called from any form as an event handler.
Check to See if the Task is Running
When TaskMan starts a task, it updates the Started field in the Status
Information group box. If the Completed field is blank, the task is still
running.
Also, you can see which tasks are currently running by opening the Active
Background Tasks form.
View Details About the Completed Task
After TaskMan has completed the task, even if it fails, you can view
details about its execution on the Background
Task History form. Details include:
- Task description
- Return status
- User who submitted the task
- Messages triggered by the task
Returning Error Information from an Executable
To get information back to TaskMan from an executable, use any of these
methods in the EXE:
- Put a message in the ProcessErrorLog table. These messages appear
in the Task Messages tab on the Background Task History form.
- Print the error message in a file called
taskman-install-directory\Output\task-name_task-number.txt
(for example, C:\Program Files\Infor\SyteLine\Output\APChecks_435.txt)
TaskMan will use this as an error message in the Background Task History.
- Return an integer error code. TaskMan puts the EXE return code
in the BGTaskHistory table, with return code 0 indicating success.
Related Topics
Modifying
Forms to Submit Tasks to the Background Queue