Description

RTI_TASK_SCHEDULER creates a Windows scheduler entry to launch your task at the desired time. RTI_TASK_SCHEDULER can also modify or delete existing tasks.

The RTI_TASK_SCHEDULER is member of the RTI_TASK_xxx programs. Use RTI_TASK_SCHEDULER when you need to create tasks triggered by time, independent of other programs, for example as nightly processing and background indexing.

RTI_TASK_SCHEDULER can configure one-time application parameters such as the details needed to connect to an Engine Server and configure per-task information such as the program name, parameters and start time.

[See RTI_TASK_SUBMIT to create background tasks launched by another program, such as a long running report.]

Syntax

Rslt = RTI_TASK_SCHEDULER(tasktype,<taskname>,<taskdetails>{,<overwriteflag>})

Parameters

The function has the following parameters:

ParameterDescription
tasktype

There are three possible values:

ValueDescription
ADDAdds the specified task to the task record and the windows task scheduler.

Syntax: Rslt = RTI_TASK_SCHEDULER("ADD",<taskname>,<taskdetails>{,<overwriteflag>}) If the specified taskname already exists, and the overwriteflag is not set to "1", then the task is not added and -1 is returned in rslt.

QUERYReturns the entire contents of the task schedule record for the current application or the task schedule record for the specific task as defined in the current application.

Syntax: Rslt = RTI_TASK_SCHEDULER("QUERY") Returns the entire contents of the task schedule record for the current application

Syntax: Rslt =RTI_TASK_SCHEDULER(“QUERY”, <taskname>)

Returns the task schedule record for the specific task as defined in the current application.

DELETEDeletes the specified task from the task record and the Windows Task Scheduler.

Syntax: Rslt = RTI_TASK_SCHEDULER(“DELETE”,<taskname>) Returns 1 if the task is found, 0 otherwise

tasknameThe name of the task to be added, queried or deleted.
taskdetailsAn @FM delimited array containing the information to place into the Task Scheduler for the specific job. Used with the ADD tasktype only.
overwriteflagA boolean value to determine whether the named Task should be overwritten on an ADD Tasktype.

Returns

See above for the individual tasktype values.

The Task Detail Record is outlined below. This is used with the ADD Tasktype.

Field #Description
<1>engineserver: user name (optional)
<2>engineserver: password (optional)
<3>engineserver: URL (optional)
<4>engineserver: port (optional)
<5>Task Name (same as passed-in parameter #2)
<6>Stored Procedure to invoke (optional)
<7>Command to pass
<8>starting date (in internal format)
<9>ending date (in internal format) (optional)
<10>schedule type (see below)
<11>frequency (optional – only specified for schedule type RUN_TYPE_EVERY) (see below)
<12>starting time (in internal format)
<13>idle time (minutes) (optional – only specified for schedule type RUN_TYPE_IDLE)(see below)
<14>windows user (optional)
<15>windows pwd (optional)

Fields 1-4 specify information used for the connection to the engine server, and if specified will REPLACE the values in the current task schedule record. Fields 5 – 15 are always appended to the end of the current task schedule record fields 5 – 15 (which are associated multivalues).

Schedule type is one of the following codes:

Equ RUN_TYPE_STARTUP$ To 0 – run when the Windows operating system starts up

Equ RUN_TYPE_LOGON$ To 1 – run when the user logs on

Equ RUN_TYPE_IDLE$ To 2 – run when the Windows operating system is idle (must specify idle time)

Equ RUN_TYPE_ONCE$ To 3 – run only 1 time

Equ RUN_TYPE_EVERY$ To 4 – run at scheduled frequency

For RUN_TYPE_EVERY, the frequency must be specified. It takes the form of <n><space><interval> - for example, “5 MINUTE(S)”. The valid interval choices are:

MINUTE(S)

HOUR(S)

DAY(S)

WEEK(S)

MONTH(S)

See Also

RTI_TASK_SUBMITOERUN.EXE

Notes: Application specific information is stored in the SYSENV table. The SYSTASKS table holds task specific information. The Windows scheduled task is created on the machine where you run the program. The scheduled task calls OERUN.EXE, which in turn calls the Oengineserver to run the task, so you must have an oengineserver running.

  • No labels