Using TaskMan substitution keywords

TaskMan supports substitution keywords.

Before you execute a task, TaskMan replaces substitution keywords with their appropriate values when creating a string made up of the task executable name, as defined on the Background Task Definitions form, and the task parameters that is passed from the form.

Generally, you can specify these keywords when you define task parameters for an event on a form. Some of these keywords are used to get values from TaskMan settings:

Keyword Description
BG~TASKID~ Replaced by the task number from the ActiveBGTasks and BGTaskHistory tables
BG~TASKNAME~ Replaced by the task name from the BGTaskDefinitions table
BG~CONFIG~ Replaced by the configuration name
BG~REQUSER~ Replaced by the user name requesting the task
BG~SQLLOGIN~ Login associated with the user ID used to connect to a database
BG~DSN~ Name of the DSN used by TaskMan to connect to a database
BG~UID~ User ID used by TaskMan to connect to a database
BG~SERVER~ Server name used by TaskMan to connect to a database
BG~DB~ Database name used by TaskMan to connect to a database
BG~TMHOMEDIR~ Directory where TaskMan.exe and RunReport.exe are installed
BG~ERRFILE~ When a task completes, TaskMan copies the contents of this file to BGTaskHistory, and then deletes the file
BG~OUTDIR~ Path to the output directory under the TaskMan home director

Allows EXEs to run through TaskMan to produce output

BG~ISOLATIONLEVEL~ The SQL Server isolation level used by TaskMan for reports and stored procedures

The return value is UNCOMMITTED or COMMITTED. Values are set in the Isolation Level field on the Background Task Definitions form and the Collection Read Mode field on the Process Defaults form.

BG~OUTPUTFILE~ The report output file created in the directory \TaskMan_Directory\Report\OutputFiles\user on the TaskMan machine

TaskMan also supports additional keywords used as command line switches. TaskMan deletes these keywords from the task executable and parameter string:

Keyword Description
BG~LEAVELITS~ The application wraps many literal values in ~LIT~(...). This keyword, which can be specified in an event handler on a form, tells TaskMan to leave these values. For example, you can create an event on a form that runs an EXE through TaskMan. Use this keyword to allow any ~LIT~ keywords in the parameters to be passed through to the EXE.
BG~LEAVETEMPS~ TaskMan normally puts the contents of the BG~ERRFILE~ error file in BGTaskHistory and then deletes the file. This keyword tells TaskMan to leave the error files.