Home > Class Reference > %SYS namespace > %SYS.Task.History

%SYS.Task.History

persistent class %SYS.Task.History extends %Library.Persistent

SQL Table Name: %SYS_Task.History

Used to track events in the TASKMGR environment When jobs are completed Deletion of tasks Updates to Configuration data Starting of the TASKMGR Suspending/Resuming Tasks or TASKMGR

Property Inventory

Method Inventory

Parameters

parameter DOMAIN = %Utility;

Properties

property DisplayErrorDate as %Date [ Transient ];
Property methods: DisplayErrorDateCompute(), DisplayErrorDateDisplayToLogical(), DisplayErrorDateGet(), DisplayErrorDateIsValid(), DisplayErrorDateLogicalToDisplay(), DisplayErrorDateLogicalToOdbc(), DisplayErrorDateNormalize(), DisplayErrorDateOdbcToLogical(), DisplayErrorDateSQLCompute(), DisplayErrorDateSet(), DisplayErrorDateSetT()
property DisplayErrorNumber as %String [ Transient ];
Property methods: DisplayErrorNumberCompute(), DisplayErrorNumberDisplayToLogical(), DisplayErrorNumberGet(), DisplayErrorNumberIsValid(), DisplayErrorNumberLogicalToDisplay(), DisplayErrorNumberLogicalToOdbc(), DisplayErrorNumberNormalize(), DisplayErrorNumberSQLCompute(), DisplayErrorNumberSet(), DisplayErrorNumberSetT()
property DisplayFinished as %String [ Transient ];
Property methods: DisplayFinishedCompute(), DisplayFinishedDisplayToLogical(), DisplayFinishedGet(), DisplayFinishedIsValid(), DisplayFinishedLogicalToDisplay(), DisplayFinishedLogicalToOdbc(), DisplayFinishedNormalize(), DisplayFinishedSQLCompute(), DisplayFinishedSet(), DisplayFinishedSetT()
property DisplayLogDate as %String (MAXLEN = 255) [ Transient ];
Property methods: DisplayLogDateCompute(), DisplayLogDateDisplayToLogical(), DisplayLogDateGet(), DisplayLogDateIsValid(), DisplayLogDateLogicalToDisplay(), DisplayLogDateLogicalToOdbc(), DisplayLogDateNormalize(), DisplayLogDateSQLCompute(), DisplayLogDateSet(), DisplayLogDateSetT()
property DisplayStarted as %String [ Transient ];
Property methods: DisplayStartedCompute(), DisplayStartedDisplayToLogical(), DisplayStartedGet(), DisplayStartedIsValid(), DisplayStartedLogicalToDisplay(), DisplayStartedLogicalToOdbc(), DisplayStartedNormalize(), DisplayStartedSQLCompute(), DisplayStartedSet(), DisplayStartedSetT()
property DisplayStatus as %String (MAXLEN = 1024) [ Transient ];
Property methods: DisplayStatusCompute(), DisplayStatusDisplayToLogical(), DisplayStatusGet(), DisplayStatusIsValid(), DisplayStatusLogicalToDisplay(), DisplayStatusLogicalToOdbc(), DisplayStatusNormalize(), DisplayStatusSQLCompute(), DisplayStatusSet(), DisplayStatusSetT()
property ER as %String (MAXLEN = 20);
$lb(date,index) in %ER global on error
Property methods: ERDisplayToLogical(), ERGet(), ERGetStored(), ERIsValid(), ERLogicalToDisplay(), ERLogicalToOdbc(), ERNormalize(), ERSet()
property Error as %String (MAXLEN = 1024);
Untrapped error from User task, or "Success"
Property methods: ErrorDisplayToLogical(), ErrorGet(), ErrorGetStored(), ErrorIsValid(), ErrorLogicalToDisplay(), ErrorLogicalToOdbc(), ErrorNormalize(), ErrorSet()
property ExecuteCode as %String (MAXLEN = 32000);
Code That was run
Property methods: ExecuteCodeDisplayToLogical(), ExecuteCodeGet(), ExecuteCodeGetStored(), ExecuteCodeIsValid(), ExecuteCodeLogicalToDisplay(), ExecuteCodeLogicalToOdbc(), ExecuteCodeNormalize(), ExecuteCodeSet()
property LastFinished as %String [ InitialExpression = 0 ];
$h Value of when the task was last finished
0 - Never finished
Property methods: LastFinishedDisplayToLogical(), LastFinishedGet(), LastFinishedGetStored(), LastFinishedIsValid(), LastFinishedLogicalToDisplay(), LastFinishedLogicalToOdbc(), LastFinishedNormalize(), LastFinishedSet()
property LastStarted as %String [ InitialExpression = 0 ];
$h Value of when the task was last started
0 - Never started
Property methods: LastStartedDisplayToLogical(), LastStartedGet(), LastStartedGetStored(), LastStartedIsValid(), LastStartedLogicalToDisplay(), LastStartedLogicalToOdbc(), LastStartedNormalize(), LastStartedSet()
property LogDate as %Date;
Date the log entry is made
Property methods: LogDateDisplayToLogical(), LogDateExists(), LogDateGet(), LogDateGetStored(), LogDateIsValid(), LogDateLogicalToDisplay(), LogDateLogicalToOdbc(), LogDateNormalize(), LogDateOdbcToLogical(), LogDateSet()
property LogTime as %Time;
Time the log entry is made
Property methods: LogTimeDisplayToLogical(), LogTimeGet(), LogTimeGetStored(), LogTimeIsValid(), LogTimeLogicalToDisplay(), LogTimeLogicalToOdbc(), LogTimeNormalize(), LogTimeOdbcToLogical(), LogTimeSet()
property Name as %String (MAXLEN = 32000);
Name of the task. Must be 16 characters or less, first character must be a letter.
Property methods: NameDisplayToLogical(), NameGet(), NameGetStored(), NameIsValid(), NameLogicalToDisplay(), NameLogicalToOdbc(), NameNormalize(), NameSet(), NameSpaceDisplayToLogical(), NameSpaceGet(), NameSpaceGetStored(), NameSpaceIsValid(), NameSpaceLogicalToDisplay(), NameSpaceLogicalToOdbc(), NameSpaceNormalize(), NameSpaceSet()
property NameSpace as %String (MAXLEN = 64) [ InitialExpression = "%SYS" ];
Namespace the task ran in
Property methods: NameSpaceDisplayToLogical(), NameSpaceGet(), NameSpaceGetStored(), NameSpaceIsValid(), NameSpaceLogicalToDisplay(), NameSpaceLogicalToOdbc(), NameSpaceNormalize(), NameSpaceSet()
property RunningJobNumber as %String;
$J value of the job which ran the task
Property methods: RunningJobNumberDisplayToLogical(), RunningJobNumberGet(), RunningJobNumberGetStored(), RunningJobNumberIsValid(), RunningJobNumberLogicalToDisplay(), RunningJobNumberLogicalToOdbc(), RunningJobNumberNormalize(), RunningJobNumberSet()
property Status as %CacheString [ InitialExpression = 0 ];
Value of Status if ExecuteCode is Set Status=
Property methods: StatusGet(), StatusGetStored(), StatusIsValid(), StatusSet()
property Task as %SYS.Task;
ID of Task
Property methods: TaskExists(), TaskGet(), TaskGetObject(), TaskGetObjectId(), TaskGetStored(), TaskGetSwizzled(), TaskHistoryClose(), TaskHistoryDetailClose(), TaskHistoryDetailExecute(), TaskHistoryDetailFetch(), TaskHistoryDetailFetchRows(), TaskHistoryDetailFunc(), TaskHistoryDetailGetInfo(), TaskHistoryDetailGetODBCInfo(), TaskHistoryDetailPrepare(), TaskHistoryDetailSendODBC(), TaskHistoryExecute(), TaskHistoryFetch(), TaskHistoryFetchRows(), TaskHistoryForDayClose(), TaskHistoryForDayExecute(), TaskHistoryForDayFetch(), TaskHistoryForDayFetchRows(), TaskHistoryForDayFunc(), TaskHistoryForDayGetInfo(), TaskHistoryForDayGetODBCInfo(), TaskHistoryForDayPrepare(), TaskHistoryForDaySendODBC(), TaskHistoryForTaskClose(), TaskHistoryForTaskExecute(), TaskHistoryForTaskFetch(), TaskHistoryForTaskFetchRows(), TaskHistoryForTaskForDayClose(), TaskHistoryForTaskForDayExecute(), TaskHistoryForTaskForDayFetch(), TaskHistoryForTaskForDayFetchRows(), TaskHistoryForTaskForDayFunc(), TaskHistoryForTaskForDayGetInfo(), TaskHistoryForTaskForDayGetODBCInfo(), TaskHistoryForTaskForDayPrepare(), TaskHistoryForTaskForDaySendODBC(), TaskHistoryForTaskFunc(), TaskHistoryForTaskGetInfo(), TaskHistoryForTaskGetODBCInfo(), TaskHistoryForTaskPrepare(), TaskHistoryForTaskSendODBC(), TaskHistoryFunc(), TaskHistoryGetInfo(), TaskHistoryGetODBCInfo(), TaskHistoryPrepare(), TaskHistorySendODBC(), TaskIsValid(), TaskNewObject(), TaskSet(), TaskSetObject(), TaskSetObjectId(), TaskUnSwizzle()
property Username as %String;
Property methods: UsernameDisplayToLogical(), UsernameGet(), UsernameGetStored(), UsernameIsValid(), UsernameLogicalToDisplay(), UsernameLogicalToOdbc(), UsernameNormalize(), UsernameSet()

Methods

method %OnBeforeSave(Insert As %Library.Boolean) as %Status
Inherited description: This callback method is invoked by the %Save() method to provide notification that the object is being saved. It is called before any data is written to disk.

insert will be set to 1 if this object is being saved for the first time.

If this method returns an error then the call to %Save() will fail.

classmethod FormatTaskHistory(LastStarted As %String, Completed As %String, Name As %String, Status As %String, Result As %String) as %String
Formats a line for the TaskHistory query.
classmethod PurgeHistory(days As %Integer) as %Status
Purge Task History. This method purges the task history. It will retain Task history for the number of days set by the $SYS.Task.HistoryPurgeSet class method.

Queries

query DescendingTaskHistory(NULL)
Selects Last Start As %String, Completed As %String, Task Name As %String, Status As %String, Result As %String, Task As %String, NameSpace As %String, Routine As %String, Pid As %String, %ER Date As %String, %ER Error # As %String, Username As %String, LogDate As %Date, LogTime As %Time
SQL Query:
SELECT DisplayStarted,DisplayFinished,Name,DisplayStatus,Error,Task,Namespace,ExecuteCode,RunningJobNumber,DisplayErrorDate,DisplayErrorNumber,Username,DisplayLogDate,LogTime FROM %SYS_Task.History ORDER BY ID DESC
Returns all Task history in descending order.
query DescendingTaskHistoryDays(StartDate As %Date = +$H, EndDate As %Date = +$H)
Selects Last Start As %String, Completed As %String, Task Name As %String, Status As %String, Result As %String, Task As %String, NameSpace As %String, Routine As %String, Pid As %String, %ER Date As %String, %ER Error # As %String, Username As %String, LogDate As %Date, LogTime As %Time
SQL Query:
SELECT DisplayStarted,DisplayFinished,Name,DisplayStatus,Error,Task,Namespace,ExecuteCode,RunningJobNumber,DisplayErrorDate,DisplayErrorNumber,Username,DisplayLogDate,LogTime FROM %SYS_Task.History Where LogDate>=:StartDate and LogDate<=:EndDate ORDER BY ID DESC
query DescendingTaskHistoryForTask(Task As %Integer)
Selects Last Start As %String, Completed As %String, Status As %String, Result As %String, Task As %String, NameSpace As %String, Routine As %String, Pid As %String, %ER Date As %String, %ER Error # As %String, Task Name As %String, Username As %String, LogDate As %Date, LogTime As %Time
SQL Query:
SELECT DisplayStarted,DisplayFinished,DisplayStatus,Error,Task,Namespace,ExecuteCode,RunningJobNumber,DisplayErrorDate,DisplayErrorNumber,Name,Username,DisplayLogDate,LogTime FROM %SYS_Task.History Where Task=:Task ORDER BY ID DESC
query TaskHistory(NULL)
Selects Last Start As %String, Completed As %String, Task Name As %String, Status As %String, Result As %String, Task As %String, NameSpace As %String, Routine As %String, Pid As %String, %ER Date As %String, %ER Error # As %String, Username As %String, LogDate As %Date, LogTime As %Time
SQL Query:
SELECT DisplayStarted,DisplayFinished,Name,DisplayStatus,Error,Task,Namespace,ExecuteCode,RunningJobNumber,DisplayErrorDate,DisplayErrorNumber,Username,DisplayLogDate,LogTime FROM %SYS_Task.History
Returns a Task's history.
This query loops through the task history and returns information concerning when the task was run
query TaskHistoryDetail(NULL)
Selects Last Start As %String, Completed As %String, Task Name As %String, Status As %String, Result As %String, NameSpace As %String, Routine As %String, Pid As %String, %ER Date As %String, %ER Error # As %String, Task As %String, Username As %String, LogDate As %Date, LogTime As %Time
SQL Query:
SELECT DisplayStarted,DisplayFinished,Name,DisplayStatus,Error,Namespace,ExecuteCode,RunningJobNumber,DisplayErrorDate,DisplayErrorNumber,Task,Username,DisplayLogDate,LogTime FROM %SYS_Task.History
query TaskHistoryForDay(StartDate As %Date = +$H, EndDate As %Date = +$H)
Selects Last Start As %String, Completed As %String, Status As %String, Result As %String, Task As %String, NameSpace As %String, Routine As %String, Pid As %String, %ER Date As %String, %ER Error # As %String, Task Name As %String, Username As %String, LogDate As %Date, LogTime As %Time
SQL Query:
SELECT DisplayStarted,DisplayFinished,DisplayStatus,Error,Task,Namespace,ExecuteCode,RunningJobNumber,DisplayErrorDate,DisplayErrorNumber,Name,Username,DisplayLogDate,LogTime FROM %SYS_Task.History Where LogDate>=:StartDate and LogDate<=:EndDate
query TaskHistoryForTask(Task As %Integer)
Selects Last Start As %String, Completed As %String, Status As %String, Result As %String, Task As %String, NameSpace As %String, Routine As %String, Pid As %String, %ER Date As %String, %ER Error # As %String, Task Name As %String, Username As %String, LogDate As %Date, LogTime As %Time
SQL Query:
SELECT DisplayStarted,DisplayFinished,DisplayStatus,Error,Task,Namespace,ExecuteCode,RunningJobNumber,DisplayErrorDate,DisplayErrorNumber,Name,Username,DisplayLogDate,LogTime FROM %SYS_Task.History Where Task=:Task
query TaskHistoryForTaskForDay(Task As %Integer, StartDate As %Date = +$H, EndDate As %Date = +$H)
Selects Last Start As %String, Completed As %String, Status As %String, Result As %String, Task As %String, NameSpace As %String, Routine As %String, Pid As %String, %ER Date As %String, %ER Error # As %String, Task Name As %String, Username As %String, LogDate As %Date, LogTime As %Time
SQL Query:
SELECT DisplayStarted,DisplayFinished,DisplayStatus,Error,Task,Namespace,ExecuteCode,RunningJobNumber,DisplayErrorDate,DisplayErrorNumber,Name,Username,DisplayLogDate,LogTime FROM %SYS_Task.History Where Task=:Task and LogDate>=:StartDate and LogDate<=:EndDate

Indexes

index (LogDate on LogDate);
Index methods: LogDateDisplayToLogical(), LogDateExists(), LogDateGet(), LogDateGetStored(), LogDateIsValid(), LogDateLogicalToDisplay(), LogDateLogicalToOdbc(), LogDateNormalize(), LogDateOdbcToLogical(), LogDateSet()
index (Task on Task);
Index methods: TaskExists(), TaskGet(), TaskGetObject(), TaskGetObjectId(), TaskGetStored(), TaskGetSwizzled(), TaskHistoryClose(), TaskHistoryDetailClose(), TaskHistoryDetailExecute(), TaskHistoryDetailFetch(), TaskHistoryDetailFetchRows(), TaskHistoryDetailFunc(), TaskHistoryDetailGetInfo(), TaskHistoryDetailGetODBCInfo(), TaskHistoryDetailPrepare(), TaskHistoryDetailSendODBC(), TaskHistoryExecute(), TaskHistoryFetch(), TaskHistoryFetchRows(), TaskHistoryForDayClose(), TaskHistoryForDayExecute(), TaskHistoryForDayFetch(), TaskHistoryForDayFetchRows(), TaskHistoryForDayFunc(), TaskHistoryForDayGetInfo(), TaskHistoryForDayGetODBCInfo(), TaskHistoryForDayPrepare(), TaskHistoryForDaySendODBC(), TaskHistoryForTaskClose(), TaskHistoryForTaskExecute(), TaskHistoryForTaskFetch(), TaskHistoryForTaskFetchRows(), TaskHistoryForTaskForDayClose(), TaskHistoryForTaskForDayExecute(), TaskHistoryForTaskForDayFetch(), TaskHistoryForTaskForDayFetchRows(), TaskHistoryForTaskForDayFunc(), TaskHistoryForTaskForDayGetInfo(), TaskHistoryForTaskForDayGetODBCInfo(), TaskHistoryForTaskForDayPrepare(), TaskHistoryForTaskForDaySendODBC(), TaskHistoryForTaskFunc(), TaskHistoryForTaskGetInfo(), TaskHistoryForTaskGetODBCInfo(), TaskHistoryForTaskPrepare(), TaskHistoryForTaskSendODBC(), TaskHistoryFunc(), TaskHistoryGetInfo(), TaskHistoryGetODBCInfo(), TaskHistoryPrepare(), TaskHistorySendODBC(), TaskIsValid(), TaskNewObject(), TaskSet(), TaskSetObject(), TaskSetObjectId(), TaskUnSwizzle()

Inherited Members

Inherited Methods

Storage

Storage Model: CacheStorage (%SYS.Task.History)

^|"^^"_$ZU(12)|SYS("Task","HistoryD")(ID)
=
%%CLASSNAME
ER
Error
ExecuteCode
LastFinished
LastStarted
Name
NameSpace
Number
RunningJobNumber
Status
Task
LogDate
LogTime
Username

Subclasses