Description
RTI_TASK_SUBMIT creates and optionally launches a background task. It is a member of the RTI_TASK_xxx programs. Use RTI_TASK_SUBMIT to trigger a background task from a program.
RTI_TASK_SUBMIT allows you to launch tasks which require the presentation server, for example OIPI reports. It can be configured to start up an additional OpenInsight for each requested task, or to maintain a “background queue” of OpenInsight invocations that can be used to process requests in the order they are submitted.
[See RTI_TASK_SCHEDULER for the case where you to create a task triggered by time.]
Syntax
Rslt = RTI_TASK_SUBMIT(callType, funcName {,<param1>} {,<param2>}… {,<param10>})
Parameters
The function has the following parameters:
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
callType | There are three possible values:
| ||||||||||
funcName | The name of the fuction or subroutine to execute. | ||||||||||
taskdetails | An @FM delimited array containing the information to place into the Task Scheduler for the specific job. Used with the ADD tasktype only. | ||||||||||
{,<param1>}, {,<param2>}...{,<param10>} | The arguments for the function. RTI_TASK_SUBMIT supports functions with up to ten arguments. |
Returns
The “task ID” of the newly submitted task. The TaskID will be used to query the background processor about the status of the request, and retrieve any generated results, with the RTI_TASK_STATUS call
RTI_TASK_SUBMIT uses the ShellExecute function to launch a new Oinsight.exe to execute the task. Unlike OERUN, which similarly runs background tasks via the engine server, RTI_TASK_SUBMIT uses oinsight.exe to support tasks which require the presentation server, such as OIPI reports.
In immediate mode, the launched OInsight.exe will execute the requested task and terminate. In polling mode, the launched OInsight.exe will check to see if a “task manager” is currently running, and if it is not, it will remain running as the task manager, dispatching the requests to additional OInsight.exe instances. If a task manager is already running, the launched OInsight.exe will terminate, leaving the processing of the task to the already-running task manager.
See RTI_TASKMANAGER for configuration information.
RTI_TASK_SUBMIT can be called from any program, including other tasks or programs that are not in event context, such as INET and O4W routines. Launching OIPI reports and returning PDFS to web clients is a common use.
See Also
RTI_TASK_STATUS, RTI_TASK_STARTUP, RTI_TASK_SHUTDOWN, RTI_TASKMANAGER
1 Comment
Don Bakke
Learned a few things that are not obvious to make this work properly:
The docs above refer to a taskdetails argument, but the syntax omits this. The syntax is correct. taskdetails is a holdover and should be ignored.
Behind the scenes, OpenInsight attempts to run the Declare_FCNS routine to create a DLL stub for the ShellExecute WinAPI. However, due to a missing row, this produces a Set_Status() error. This does not prevent RTI_TASK_SUBMIT from running, but it could cause problems for developer code that relies upon Get_Status() to verify that everything is in good shape. To avoid this issue, run the following from the System Monitor: