EnumRunningTasks

Returns information about the running tasks that meet the selection criteria. Criteria include task type, user, application server, user session, and task status. Task information is returned in arrays that have a one-to-one correspondence.

Note:

To also return flags that indicate whether the tasks currently are running or stopped, use EnumRunningTasksEx.

The lStartRecord and lEndRecord arguments specify the starting and ending indexes of the range of records, and the plTotalRecords argument returns the total number of records that match the selection criteria. To iterate through all the matching records, in the first call to EnumRunningTasks pass 0 to lStartRecord, then use the count returned by plTotalRecords to loop through the remaining records.

Note:

The number of matching records can change after you call EnumRunningTasks. For example, a new task could be added.

Syntax

<HFMwSystemInfo>.EnumRunningTasks (vbAllTaskTypes, lTaskType, vbAllUsers, bstrUserName, vbAllServers, bstrServerName, vbAllSessions, vbAllStatus, lStatus, lStartRecord, lEndRecord, pvaravarTaskIDs, pvaravarTaskTypes, pvaravarTaskProgress, pvaravarTaskStatus, pvaravarUserNames, pvaravarServerNames, pvaravarStartTimes, pvaravarStartRunningTimes, pvaravarLastUpdateTimes, pvaravarDescriptions, pvaravarLogFiles)

Argument

Description

vbAllTaskTypes

A flag that specifies whether to filter for a specific type of task. Pass TRUE to return information for all tasks, FALSE to filter by the type of task specified by the lTaskType argument.

Input argument. Boolean subtype.

lTaskType

Long (ByVal). The ID of the task type for which to return information. This argument is used only if the vbAllTaskTypes argument is set to FALSE.

Following are the constants that represent valid values. These are from the HFMConstants enumeration tagUSERACTIVITYCODE:

  • USERACTIVITYCODE_CONSOLIDATION: consolidations

  • USERACTIVITYCODE_DATA_LOAD: data loads

  • USERACTIVITYCODE_EA_EXPORT: Extended Analytics exports

  • USERACTIVITYCODE_IC_POSTALL: post all intercompany transactions

  • USERACTIVITYCODE_IC_UNPOSTALL: unpost all intercompany transactions

  • USERACTIVITYCODE_IC_DELETEALL: delete all intercompany transactions

  • USERACTIVITYCODE_IC_UNMATCHALL: unmatch all intercompany transactions

  • USERACTIVITYCODE_IC_AUTOMATCHBYID: automatch intercompany transactions by ID

  • USERACTIVITYCODE_IC_AUTOMATCHBYACCT: automatch intercompany transactions by account

  • USERACTIVITYCODE_IC_MATCHINGRPTBYID: matching intercompany transactions by ID report

  • USERACTIVITYCODE_IC_MATCHINGRPTBYACCT: matching intercompany transactions by account report

  • USERACTIVITYCODE_IC_TRANSACTIONRPT: intercompany transactions report

Input argument. Long subtype.

vbAllUsers

A flag that specifies whether to filter by user. Pass TRUE for all users, FALSE to filter by the user specified with the bstrUserName argument.

Input argument. Boolean subtype.

bstrUserName

The username for which to return task information. This argument is used only if the vbAllUsers argument is set to FALSE.

Input argument. String subtype.

vbAllServers

A flag that specifies whether to filter by application server. Pass TRUE for all application servers, FALSE to filter by the application server specified with the bstrServerName argument.

Input argument. Boolean subtype.

bstrServerName

The name of the application server for which to return task information. This argument is used only if the vbAllServers argument is set to FALSE.

Input argument. String subtype.

vbAllSessions

Specifies whether to return information for all user sessions or only the session for the connected user. Pass TRUE for all sessions, FALSE otherwise.

Input argument. Boolean subtype.

vbAllStatus

Specifies whether to filter by task status. Pass TRUE for all statuses, FALSE to filter by the status specified with the lStatus argument.

Input argument. Boolean subtype.

lStatus

The task status by which to filter. This argument is used only if the vbAllStatus argument is set to FALSE. Valid values are represented by the HFMConstants type library constants listed in Task Status Constants.

Input argument. Long subtype.

lStartRecord

The index of the first record in the range of records to retrieve. This is a zero-based index.

Input argument. Long subtype.

lEndRecord

The index of the last record in the range of records to retrieve. This is a zero-based index.

Input argument. Long subtype.

pvaravarTaskIDs

Returns an array containing the task IDs that identify the running tasks.

Input/output argument.

pvaravarTaskTypes

Returns an array containing the tasks’ types. Valid values are represented by the constants listed as valid values for the lTaskType argument.

Input/output argument.

pvaravarTaskProgress

Returns an array containing the progress complete percentages of the running tasks.

Input/output argument.

pvaravarTaskStatus

Returns an array containing the tasks’ statuses. Valid values are represented by the HFMConstants type library constants listed in Task Status Constants.

Input/output argument.

pvaravarUserNames

Returns an array containing the usernames of the running tasks’ users.

Input/output argument.

pvaravarServerNames

Returns an array containing the names of the application servers for the running tasks.

Input/output argument.

pvaravarStartTimes

Returns an array containing the timestamps of the tasks’ scheduled start times. Array items are formatted as Doubles that can be cast to the Date format.

Input/output argument.

pvaravarStartRunningTimes

Returns an array containing the timestamps of the tasks’ actual start times. Array items are formatted as Doubles that can be cast to the Date format.

Input/output argument.

pvaravarLastUpdateTimes

Returns an array containing the timestamps of the last time the tasks were updated. Array items are formatted as Doubles that can be cast to the Date format.

Input/output argument.

pvaravarDescriptions

Returns an array containing the descriptions for the tasks. The array is returned as a String subtype.

Input/output argument.

pvaravarLogFiles

Returns an array containing the file names and paths of the tasks’ log files.

Input/output argument.

Return Value

Returns a count of the number of tasks returned by EnumRunningTasks.