182
i ActiveBatch TM Developer’s Guide Version 3 The Cross-Platform Enterprise Job Management and Scheduling System Advanced Systems Concepts, Inc.

ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

Embed Size (px)

Citation preview

Page 1: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

i

ActiveBatchTM Developer’s Guide Version 3

The Cross-Platform Enterprise Job Management and Scheduling

System

Advanced Systems Concepts, Inc.

Page 2: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job
Page 3: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

i

First Printing: November 2000

The information in this document is subject to change without notice and should not be construed as a commitment by Advanced Systems Concepts, Inc. (ASCI). ASCI assumes no responsibility for any errors that may appear in this document. The software described in this document is furnished under license, and may only be used or copied in accordance with the terms of such license. The terms and conditions of the license are furnished with the product in both hard copy as well as electronic form.

ASCI logo and XLNT are registered trademarks of Advanced Systems Concepts, Inc. ASCI, ActiveBatch, ActiveBatch logo, XLNT logo and BQMS are trademarks of Advanced Systems Concepts, Inc. Microsoft, Windows NT, ActiveX and Systems Management Server are trademarks of Microsoft Corporation.

Copyright 1999-2000, Advanced Systems Concepts, Inc., Hoboken New Jersey, 07030 All Rights Reserved. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording or by any information storage and retrieval system, without the written permission of Advanced Systems Concepts, Inc.

Page 4: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job
Page 5: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

i

Table of Contents 1 INTRODUCTION ................................................................................................................................ 1

1.1 ACTIVEBATCH SCRIPTING AND PROGRAMMING .............................................................................. 2 1.2 ACTIVEBATCH OBJECT MODEL ....................................................................................................... 3

2 ACTIVEBATCH INTEGRATION EXAMPLES .............................................................................. 4 2.1 WINDOWS SCRIPTING HOST (WSH) EXAMPLES .............................................................................. 5 2.2 XLNT EXAMPLE ............................................................................................................................. 9 2.3 MICROSOFT VISUAL C++ EXAMPLE .............................................................................................. 10 2.4 MICROSOFT VISUAL BASIC EXAMPLE............................................................................................ 13 2.5 MICROSOFT EXCEL EXAMPLE........................................................................................................ 16 2.6 ACTIVE SERVER PAGES (ASP) EXAMPLE ...................................................................................... 20 2.7 MICROSOFT VISUAL J++ EXAMPLE ............................................................................................... 25 2.8 WMI EXAMPLES............................................................................................................................ 27

3 ACTIVEBATCH DEVELOPER’S REFERENCE .......................................................................... 29 3.1 ABATJOBSCHEDULER OBJECT....................................................................................................... 30

3.1.1 AddCalendar Method............................................................................................................ 33 3.1.2 AddJob Method ..................................................................................................................... 33 3.1.3 AddQueue Method................................................................................................................. 34 3.1.4 AddSchedule Method............................................................................................................. 34 3.1.5 Connect Method .................................................................................................................... 35 3.1.6 CreateObject Method............................................................................................................ 36 3.1.7 DBPurge Method .................................................................................................................. 37 3.1.8 Disconnect Method ............................................................................................................... 37 3.1.9 GetCalendar Method............................................................................................................. 38 3.1.10 GetCalendars Method ........................................................................................................... 38 3.1.11 GetErrorDescription Method................................................................................................ 39 3.1.12 GetJob Method...................................................................................................................... 40 3.1.13 GetJobPolicies Method ......................................................................................................... 41 3.1.14 GetJobPolicy Method............................................................................................................ 41 3.1.15 GetJobPolicySecurityAccounts Method ................................................................................ 42 3.1.16 GetJobs Method .................................................................................................................... 42 3.1.17 GetJobsByDate Method ........................................................................................................ 43 3.1.18 GetQueue Method ................................................................................................................. 43 3.1.19 GetQueuePolicies Method .................................................................................................... 44 3.1.20 GetQueuePolicy Method ....................................................................................................... 44 3.1.21 GetQueuePolicySecurityAccounts Method............................................................................ 45 3.1.22 GetQueues Method................................................................................................................ 45 3.1.23 GetSchedule Method ............................................................................................................. 46 3.1.24 GetSchedulePolicySecurityAccounts Method........................................................................ 46 3.1.25 GetSchedules Method............................................................................................................ 47 3.1.26 GetSystemPolicies Method.................................................................................................... 47 3.1.27 GetSystemPolicy Method ...................................................................................................... 48 3.1.28 GetSystemSecurityAccounts Method..................................................................................... 48 3.1.29 IsAdministrator Method ........................................................................................................ 49 3.1.30 IsConnected Method ............................................................................................................. 49 3.1.31 Update Method...................................................................................................................... 50 3.1.32 UpdateCounters Method ....................................................................................................... 50

3.2 ABATQUEUE OBJECT..................................................................................................................... 51 3.2.1 Close Method ........................................................................................................................ 54 3.2.2 Delete Method....................................................................................................................... 54 3.2.3 Flush Method ........................................................................................................................ 55 3.2.4 GetAssociatedExecutionQueues Method............................................................................... 55

Page 6: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

ii

3.2.5 GetExecutionMachineCharacteristics Method ..................................................................... 56 3.2.6 GetJobs Method .................................................................................................................... 56 3.2.7 GetSecurityAccounts Method ................................................................................................ 57 3.2.8 GetUserCharacteristics Method ........................................................................................... 57 3.2.9 Open Method......................................................................................................................... 58 3.2.10 Start Method.......................................................................................................................... 58 3.2.11 Stop Method .......................................................................................................................... 59 3.2.12 TakeOwnership Method ........................................................................................................ 59 3.2.13 Update Method...................................................................................................................... 60 3.2.14 UpdateCounters Method ....................................................................................................... 60

3.3 ABATQUEUES OBJECT................................................................................................................... 61 3.3.1 Add Method........................................................................................................................... 62 3.3.2 Remove Method..................................................................................................................... 62

3.4 ABATPOLICY OBJECT .................................................................................................................... 63 3.4.1 Update Method...................................................................................................................... 64

3.5 ABATPOLICIES OBJECT.................................................................................................................. 65 3.6 ABATSCHEDULE OBJECT ............................................................................................................... 66

3.6.1 CopyObject Method .............................................................................................................. 68 3.6.2 Delete Method....................................................................................................................... 68 3.6.3 GetAssociatedJobs Method ................................................................................................... 69 3.6.4 GetSecurityAccounts Method ................................................................................................ 69 3.6.5 TakeOwnership Method ........................................................................................................ 70 3.6.6 TimeSpec_GetExactTimes Method........................................................................................ 70 3.6.7 Update Method...................................................................................................................... 71

3.7 ABATSCHEDULES OBJECT ............................................................................................................. 72 3.7.1 Add Method........................................................................................................................... 73 3.7.2 Remove Method..................................................................................................................... 73

3.8 ABATCALENDAR OBJECT .............................................................................................................. 74 3.8.1 Delete Method....................................................................................................................... 75 3.8.2 GetFixedHolidays Method .................................................................................................... 75 3.8.3 GetRelativeHolidays Method ................................................................................................ 76 3.8.4 GetSecurityAccounts Method ................................................................................................ 76 3.8.5 TakeOwnership Method ........................................................................................................ 77 3.8.6 Update Method...................................................................................................................... 77

3.9 ABATCALENDARS OBJECT............................................................................................................. 78 3.9.1 Add Method........................................................................................................................... 79 3.9.2 Remove Method..................................................................................................................... 79

3.10 ABATJOB OBJECT .......................................................................................................................... 80 3.10.1 Abort Method ........................................................................................................................ 87 3.10.2 CopyObject Method .............................................................................................................. 87 3.10.3 Delete Method....................................................................................................................... 88 3.10.4 GetAlerts Method .................................................................................................................. 88 3.10.5 GetAssociatedSchedules Method .......................................................................................... 89 3.10.6 GetAudits Method ................................................................................................................. 89 3.10.7 GetDependencies Method ..................................................................................................... 90 3.10.8 GetEventTriggers Method..................................................................................................... 90 3.10.9 GetExclusionList Method ...................................................................................................... 91 3.10.10 GetExecutionMachineCharacteristics Method ................................................................. 91 3.10.11 GetHistory Method............................................................................................................ 92 3.10.12 GetJobFailureStarts Method............................................................................................. 92 3.10.13 GetJobSuccessStarts Method ............................................................................................ 93 3.10.14 GetNotifications Method ................................................................................................... 93 3.10.15 GetSecurityAccounts Method ............................................................................................ 94 3.10.16 GetUserCharacteristics Method ....................................................................................... 94 3.10.17 Hold Method ..................................................................................................................... 95 3.10.18 IsJobTemplate Method...................................................................................................... 95

Page 7: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

iii

3.10.19 MoveTo Method ................................................................................................................ 96 3.10.20 Pause Method.................................................................................................................... 96 3.10.21 ReleaseJob Method ........................................................................................................... 97 3.10.22 ResetMonitorCPUTimeAverages Method ......................................................................... 97 3.10.23 ResetMonitorRunTimeAverages Method........................................................................... 98 3.10.24 Restart Method.................................................................................................................. 98 3.10.25 Resume Method ................................................................................................................. 99 3.10.26 Synchronize Method.......................................................................................................... 99 3.10.27 TakeOwnership Method .................................................................................................. 100 3.10.28 Trigger Method ............................................................................................................... 100 3.10.29 Update Method................................................................................................................ 101

3.11 ABATJOBS OBJECT ...................................................................................................................... 102 3.11.1 Add Method......................................................................................................................... 103 3.11.2 Remove Method................................................................................................................... 103

3.12 ABATJOBALERT OBJECT ............................................................................................................. 104 3.13 ABATJOBALERTS OBJECT............................................................................................................ 105

3.13.1 Add Method......................................................................................................................... 106 3.13.2 Remove Method................................................................................................................... 106

3.14 ABATJOBAUDIT OBJECT.............................................................................................................. 107 3.15 ABATJOBAUDITS OBJECT............................................................................................................ 108 3.16 ABATJOBDEPENDENCY OBJECT .................................................................................................. 109 3.17 ABATJOBDEPENDENCIES OBJECT................................................................................................ 110

3.17.1 Add Method......................................................................................................................... 111 3.17.2 Remove Method................................................................................................................... 111 3.17.3 MoveItemTo Method ........................................................................................................... 112

3.18 ABATJOBEVENTTRIGGER OBJECT............................................................................................... 113 3.18.1 GetPrivileges Method ......................................................................................................... 114

3.19 ABATJOBEVENTTRIGGERS OBJECT ............................................................................................. 115 3.19.1 Add Method......................................................................................................................... 116 3.19.2 Remove Method................................................................................................................... 116

3.20 ABATJOBHISTORY OBJECT.......................................................................................................... 117 3.21 ABATJOBNOTIFICATION OBJECT ................................................................................................. 120 3.22 ABATJOBNOTIFICATIONS OBJECT ............................................................................................... 121

3.22.1 Add Method......................................................................................................................... 122 3.22.2 Remove Method................................................................................................................... 122

3.23 ABATCHARACTERISTIC OBJECT .................................................................................................. 123 3.24 ABATCHARACTERISTICS OBJECT................................................................................................. 124

3.24.1 Add Method......................................................................................................................... 125 3.24.2 Remove Method................................................................................................................... 125

3.25 ABATSECURITYACCOUNT OBJECT .............................................................................................. 126 3.26 ABATSECURITYACCOUNTS OBJECT ............................................................................................ 127

3.26.1 Add Method......................................................................................................................... 128 3.26.2 Remove Method................................................................................................................... 128

3.27 ABATVARIANTITEM OBJECT ....................................................................................................... 129 3.28 ABATVARIANTITEMS OBJECT ..................................................................................................... 130

3.28.1 Add Method......................................................................................................................... 131 3.28.2 Remove Method................................................................................................................... 131

4 ACTIVEBATCH CONSTANTS ..................................................................................................... 132 4.1.1 enumAuthenticationLevel Constants ................................................................................... 133 4.1.2 enumCalendarSecurityAccess Constants ............................................................................ 133 4.1.3 enumCalendarType Constants ............................................................................................ 133 4.1.4 enumCharacteristicComparisonType Constants................................................................. 134 4.1.5 enumCharacteristicType Constants .................................................................................... 134 4.1.6 enumCharacteristicUnit Constants ..................................................................................... 134 4.1.7 enumEventType Constants .................................................................................................. 135

Page 8: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

iv

4.1.8 enumImpersonationLevel Constants ................................................................................... 135 4.1.9 enumJobAlertActionType Constants ................................................................................... 135 4.1.10 enumJobAlertType Constants.............................................................................................. 136 4.1.11 enumJobAuditType Constants............................................................................................. 136 4.1.12 enumJobDependentFailActionType Constants ................................................................... 137 4.1.13 enumJobDependentInstanceType Constants....................................................................... 137 4.1.14 enumJobDependentLogicalOperationType Constants........................................................ 137 4.1.15 enumJobDependentTriggerType Constants ........................................................................ 137 4.1.16 enumJobDependentType Constants .................................................................................... 138 4.1.17 enumJobDependentWaitDurationUnit Constants............................................................... 138 4.1.18 enumJobDependentWaitIntervalUnit Constants................................................................. 139 4.1.19 enumJobEventTriggerFlags Constants ............................................................................... 139 4.1.20 enumJobEventTriggerType Constants ................................................................................ 139 4.1.21 enumJobFlags Constants .................................................................................................... 140 4.1.22 enumJobHistoryExecutionReason Constants...................................................................... 140 4.1.23 enumJobLogType Constants ............................................................................................... 140 4.1.24 enumJobMonitorTimeType Constants................................................................................. 140 4.1.25 enumJobNotificationTime Constants .................................................................................. 141 4.1.26 enumJobNotificationType Constants .................................................................................. 141 4.1.27 enumJobOnActiveActionType Constants ............................................................................ 141 4.1.28 enumJobQSelectionType Constants .................................................................................... 141 4.1.29 enumJobSecurityAccess Constants ..................................................................................... 142 4.1.30 enumJobState Constants ..................................................................................................... 142 4.1.31 enumJobSubState Constants ............................................................................................... 143 4.1.32 enumJobTimerTriggerType Constants................................................................................ 143 4.1.33 enumJobTimeZoneType Constants...................................................................................... 144 4.1.34 enumJobTriggerFlags Constants ........................................................................................ 144 4.1.35 enumJobType Constants ..................................................................................................... 144 4.1.36 enumPolicyType Constants ................................................................................................. 145 4.1.37 enumQueueAlgorithmType Constants................................................................................. 145 4.1.38 enumQueueQueryType Constants....................................................................................... 145 4.1.39 enumQueueSecurityAccess Constants................................................................................. 146 4.1.40 enumQueueState Constants................................................................................................. 146 4.1.41 enumQueueType Constants................................................................................................. 146 4.1.42 enumScheduleDays Constants ............................................................................................ 147 4.1.43 enumScheduleDaySpecType Constants............................................................................... 147 4.1.44 enumScheduleFixedHolidayType Constants ....................................................................... 147 4.1.45 enumScheduleInstanceDay Constants................................................................................. 148 4.1.46 enumScheduleInstanceType Constants ............................................................................... 148 4.1.47 enumScheduleMonthlyType Constants................................................................................ 148 4.1.48 enumScheduleMonths Constants......................................................................................... 149 4.1.49 enumScheduleSecurityAccess Constants............................................................................. 149 4.1.50 enumScheduleTimeSpecType Constants ............................................................................. 150 4.1.51 enumScheduleYearlyType Constants .................................................................................. 150 4.1.52 enumSearchType Constants ................................................................................................ 150 4.1.53 enumSecurableObject Constants ........................................................................................ 150 4.1.54 enumSecurityAccessType Constants ................................................................................... 151 4.1.55 enumSystemSecurityAccess Constants ................................................................................ 151

5 ACTIVEBATCH WMI PROVIDER EVENTS ............................................................................. 152

6 ACTIVEBATCH MESSAGES ........................................................................................................ 156

Page 9: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

v

Table of Code Listings

Listing 1 – WSH Active system analysis example ......................................................................................... 6 Listing 2 – WSH Example for Schedule creation and association.................................................................. 8 Listing 3 – XLNT Active system analysis example........................................................................................ 9 Listing 4 – Visual C++ Example for displaying all jobs currently running or have run ............................... 12 Listing 5 – VB Example for showing the dates/times when a job(s) will execute........................................ 15 Listing 6 – Excel Example to illustrate a performance analysis of ActiveBatch .......................................... 19 Listing 7 – ASP Example (Part I) for logging into ActiveBatch................................................................... 21 Listing 8 – ASP Example (Part II) examining the ActiveBatch system........................................................ 23 Listing 9 – Visual J++ example for examining the ActiveBatch system ...................................................... 26 Listing 10 – WMI Sample Query for All ActiveBatch Events ..................................................................... 27 Listing 11 – WMI Sample Query for Job Added Events .............................................................................. 28

Page 10: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job
Page 11: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

1

1 Introduction Welcome to the ActiveBatch Developer’s Guide. This guide was designed specifically for scriptwriters and developers who are building and deploying integrated solutions with ActiveBatch. ActiveBatch delivers a programmable interface that allows users to build custom solutions using its Advanced Scheduling and Event capabilities.

This documentation contains five main sections:

• = ActiveBatch Object Model

• = ActiveBatch Integration Examples

• = ActiveBatch Developer’s Reference

• = WMI Provider Reference

• = WMI Examples

Page 12: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

2

1.1 ActiveBatch Scripting and Programming You can write programs to control the ActiveBatch application in Microsoft Visual Basic for Applications (VBA), Microsoft Visual Basic, VBScript, JScript, C++, or any programming language that supports Automation. A program can use Automation to incorporate ActiveBatch’s Advanced Scheduling capabilities or to automate simple/complex repetitive tasks. For example, a program might generate an HTML page(s) that shows the state of every job on every Job Scheduler in your corporate network.

The ActiveBatch Client sub-system is Microsoft COM based. This means that ActiveBatch is a collection of objects, properties and methods. This section assumes you are familiar with scripting in whatever language you choose and that you are familiar with COM object manipulation. This section specifically exposes and documents the various objects, properties and methods that comprise the ActiveBatch system so you can either script various actions or write your own user interface.

A program controls the ActiveBatch application by accessing its objects and then using their properties and methods. Here is a brief overview:

• = Objects are the main items (e.g. Jobs, Queues, and Schedules) you work with to control ActiveBatch.

• = Properties are attributes that determine the behavior of objects. For example, the Job Object has a Name property, which represents the name of the job.

• = Methods are actions provided by an object. For example, if you wanted to tell a job that you wanted it to run right now, you would use the Trigger method on the Job Object.

Page 13: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

3

1.2 ActiveBatch Object Model Figure 1 is a drawing that visually describes the various ActiveBatch objects and their relationship.

AbatJobScheduler

AbatSchedule

AbatSchedules

AbatJobAlert

AbatJobAlerts

AbatJobAudit

AbatJobAudits

AbatJobNotification

AbatJobNotifications

AbatCharacteristic

AbatCharacteristics

AbatCalendar

AbatCalendars

AbatJobDependency

AbatJobDependencies

AbatJobEventTrigger

AbatJobEventTriggers

AbatPolicy

AbatPolicies

AbatVariantItem

AbatVariantItems

AbatJobHistory

AbatQueue

AbatQueues

AbatJob

AbatJobs

AbatSecurityAccount

AbatSecurityAccounts

Page 14: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

4

2 ActiveBatch Integration Examples The following sections contain various examples to show the ease of use of the ActiveBatch COM layer. Examples include integration with Windows Scripting Host, Advanced Systems Concepts’ XLNT, Microsoft Excel, Active Server Pages, Microsoft Visual C++ and Microsoft Visual Basic. These are only a small subset of applications that can utilize the ActiveBatch COM layer. For example, Allaire’s ColdFusion application web server can easily access COM objects from its web pages.

The files for the examples can be found on the ActiveBatch CD under the \Samples directory or it can be downloaded from http://www.advsyscon.com/products/activebatch/samples.

Page 15: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

5

2.1 Windows Scripting Host (WSH) Examples Windows Scripting Host is Microsoft’s powerful and flexible scripting engine. WSH allows for easy access to automation objects. This WSH example demonstrates how to connect and examine the current state of all Queues and Jobs on a particular Job Scheduler.

Option ExplicitOn Error Resume Next

Dim objJss

Set objJss = CreateObject("ActiveBatch.AbatJobScheduler")If Err.Number <> 0 Then ExitScript "Unable to Create ActiveBatch Job Scheduler Object"

objJss.Connect(".")If Err.Number <> 0 Then ExitScript "Unable to Connect to Job Scheduler"

ShowQueuesAndJobs(objJss)objJss.DisconnectSet objJss = Nothing

Sub ShowQueuesAndJobs(objJss)Dim objQueuesDim objQueueConst Prefix = "+-"Dim sQueueType

Set objQueues = objJss.GetQueues(7) 'All QueuesIf Err.Number <> 0 Then ExitScript "Unable to Get Queues from Job Scheduler"

for each objQueue in objQueuesIf objQueue.Type = 1 Then

sQueueType = "Execution"ElseIf objQueue.Type = 2 Then sQueueType = "Generic"Else sQueueType = "OnDemand"

End if

Wscript.Echo VbLf + Prefix + objQueue.Name + " (" + sQueueType + ")"If Err.Number <> 0 Then ExitScript "Unable to Get Queue from Job Scheduler"ShowJobs(objQueue)

nextend Sub

Sub ShowJobs (objQueue)On Error Resume Next

Dim objJobsDim objJobConst Prefix = " ---"

Set objJobs = objQueue.GetJobsIf Err.Number <> 0 Then ExitScript "Unable to Get Jobs from Queue:" + objQueue.Name

If objJobs.Count = 0 ThenWscript.Echo Prefix + " < No Jobs > "

ElseFor each objJob in objJobs

Wscript.Echo Prefix + objJob.Name + " " + GetJobState(objJob.State,objJob.SubState)

If Err.Number <> 0 Then ExitScript "Unable to Get Job from Queue " +objQueue.Name

NextEnd If

End Sub

Function GetJobState(Status, SubStatus)Dim StateString

Page 16: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

6

StateString = "["If Status = 1 Then StateString = StateString + "Executing,"If Status = 2 Then StateString = StateString + "Pending,"If Status = 3 Then StateString = StateString + "Held,"If Status = 4 Then StateString = StateString + "Completed,"If Status = 5 Then StateString = StateString + "Not Queued,"

If SubStatus = 1 Then StateString = StateString + "Executing"If SubStatus = 2 Then StateString = StateString + "Executing Pre"If SubStatus = 3 Then StateString = StateString + "Executing Post"If SubStatus = 4 Then StateString = StateString + "Queue Busy"If SubStatus = 5 Then StateString = StateString + "Waiting Dependency"If SubStatus = 6 Then StateString = StateString + "Waiting Trigger"If SubStatus = 7 Then StateString = StateString + "Waiting Multiple Instance"If SubStatus = 8 Then StateString = StateString + "Deferred"If SubStatus = 9 Then StateString = StateString + "Success"If SubStatus = 10 Then StateString = StateString + "Failure"If SubStatus = 11 Then StateString = StateString + "Aborted"If SubStatus = 12 Then StateString = StateString + "Paused"

StateString = StateString + "]"GetJobState = StateString

End Function

Sub ExitScript(sCustomMessage)If Len(sCustomMessage) > 0 Then

Wscript.Echo sCustomMessage + " : (0x" + CStr(Hex(Err.Number)) + ") " +Err.description

Else Wscript.Echo Err.descriptionEnd IfWscript.Quit Err.Number

End Sub

Listing 1 – WSH Active system analysis example

Page 17: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

7

Depending on your ActiveBatch configuration, similar output to the following should appear:

Microsoft (R) Windows Scripting Host Version 5.0 for WindowsCopyright (C) Microsoft Corporation 1996-1997. All rights reserved.

+-OnDemand (OnDemand)--- < No Jobs >

+-Local_EQ (Execution)---WaitJob [Pending,Waiting Trigger]---WaitJob [Pending,Queue Busy]

+-Tru64_EQ (Execution)---UnixTru64_DBJob [Pending,Waiting Trigger]

+-Super_EQ (Execution)---Network_SurveyJob [Pending,Waiting Trigger]

+-Slow_EQ (Execution)---MultiThreaded_Job [Pending,Waiting Trigger]

+-Broadcast_Queue (Generic)--- < No Jobs >

This WSH example demonstrates how to create a Schedule that runs a job every Monday, Friday & Sunday at 5:15 am and 6:45 pm. It will also demonstrate how to associate this Schedule with a Job and how to add the job to the OnDemand Queue. Notice that this example has no output, other than when an error may occur. Hence, it is a prime example of how you may automate a task in ActiveBatch.

Option ExplicitOn Error Resume Next

Dim myJobDim myJSSDim myScheduleDim myExactTimesDim myExactTime1Dim myExactTime2Dim myAssociatedSchedules

Set myJSS = CreateObject ("ActiveBatch.AbatJobScheduler")myJSS.Connect "."If Err.Number <> 0 Then ExitScript "Unable to Connect to Job Scheduler"

' First, we create all the objects necessarySet mySchedule = myJSS.CreateObject("Schedule")If Err.Number <> 0 Then ExitScript "Unable to Create Schedule Object"

Set myJob = myJSS.CreateObject("Job")If Err.Number <> 0 Then ExitScript "Unable to Create Job Object"

Set myExactTime1 = myJSS.CreateObject("VariantItem")If Err.Number <> 0 Then ExitScript "Unable to Create VariantItem Object"

Set myExactTime2 = myJSS.CreateObject("VariantItem")If Err.Number <> 0 Then ExitScript "Unable to Create VariantItem Object"

Page 18: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

8

' Set Schedule propertiesmySchedule.Name = "Every Mon,Fri,Sun 5:15am and 6:45pm"mySchedule.Description = "This schedule runs a job every Mon,Fri,Sun at 5:15am and6:45pm"mySchedule.TimeSpec_Type = 2 ' abatSTST_ExactTimes

' This shedule requires Exact Time SpecificationSet myExactTimes = mySchedule.TimeSpec_GetExactTimesmyExactTime1.DateTime = #5:15:00 AM#myExactTime2.DateTime = #6:45:00 PM#myExactTimes.Add myExactTime1myExactTimes.Add myExactTime2

' Weekly SchedulemySchedule.DaySpec_Type = 2 'abatSDST_Weekly' Monday, Friday, and SundaymySchedule.DaySpec_WeeklyDaysOfWeek = 2 or 32 or 1

myJob.JobFileName = "c:\testjob.bat"myJob.Name = "TestJob With a Schedule"Set myAssociatedSchedules = myJob.GetAssociatedSchedulesmyAssociatedSchedules.Add mySchedulemyJob.EnableTimerTriggers = True' Sets the trigger type to SchedulemyJob.TimerTrigger = 4 'abatJTTT_Schedule

myJSS.AddJob "TestQueue", myJobIf Err.Number <> 0 Then ExitScript "Unable to Add the Job to the Queue"

myJSS.DisconnectSet myJSS = Nothing

Sub ExitScript(sCustomMessage)If Len(sCustomMessage) > 0 Then

Wscript.Echo sCustomMessage + " : (0x" + CStr(Hex(Err.Number)) + ") " +Err.description

Else Wscript.Echo Err.descriptionEnd IfWscript.Quit Err.Number

End Sub

Listing 2 – WSH Example for Schedule creation and association

Page 19: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

9

2.2 XLNT Example This XLNT example demonstrates how to connect and examine the current state of all Queues on a particular Job Scheduler. In order to execute this example, you must save this file as with an extension of .XCS.

$! SET ver$ on error then goto ExitRtn$ objJss = WScript.CreateObject("ActiveBatch.AbatJobScheduler")$ objJss.Connect(".")$ objQueues = objJss.GetQueues(7)$ queueCount = objQueues.count$ for (counter=1,counter .LE. queueCount, counter=counter+1)$ objQueue = objQueues.item(counter)$ write $stdout "''objQueue.Name' : ''objQueue.Description'"$ endfor$ objJss.Disconnect()$ exit$ExitRtn:$ wscript.quit(1)$ exit

Listing 3 – XLNT Queue analysis example

Depending on your ActiveBatch configuration, similar output to the following should appear:

Microsoft (R) Windows Scripting Host Version 5.0 for WindowsCopyright (C) Microsoft Corporation 1996-1997. All rights reserved.

OnDemand : OnDemand QueueLocal_EQ : Local Execution QueueTru64_EQ : UNIX Tru64 Execution QueueSuper_EQ : Fast EQ on Dual Processor ServerSlow_EQ : Slow EQ on Single Processor PentiumBroadcast_Queue : Broadcast Generic Queue

Page 20: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

10

2.3 Microsoft Visual C++ Example Here is the code for a Visual C++ Console application. This example demonstrates how to find out what jobs ran or are running on the current day. It will print out the Job name as well as the Job ID for those jobs that ran or are running on the current day. To use this example, simply open Visual Studio and create a Win32 Console Application using the Application Wizard. When the wizard appears, just choose “A Hello, World! application” and then you can simply paste the following code into the file that contains the main() function. There are only two lines that may need modification depending on your installation. The first is the #import line. The directory spec may need to change to match that of your ActiveBatch installation. Secondly, the line with iJss->Connect(".") may need to change to include a username and password.

Note: This example was built and tested with Visual C++ 6 Service Pack 4.

Depending on your ActiveBatch configuration, similar output to the following should appear:

The following are all the jobs that ran/are running today :

Job Name Job ID StartTime On Queue

-------- ------ --------- --------

WaitJob 024501 10/29/01 9:45:10 AM Local_Eq

NetworkSurveyJob 024478 10/29/01 1:44:00 PM Super_Eq

NetworkSurveyJob 024479 10/29/01 2:50:00 PM Super_Eq

UnixTru64_DBJob 024578 10/29/01 1:56:00 PM Tru64_Eq

MultiThreadedJob 024579 10/29/01 2:48:00 PM Slow_Eq

Here is the entire Visual C++ code listing: // AutomationExample.cpp : Defines the entry point for the console application.//

// The directory spec is where the ActiveBatch Client files are installed#include "stdafx.h"#import "c:\program files\asci\activebatch\activebatch.dll" no_namespace

int main(int argc, char* argv[]){

// This call will initialize the COM library. This step is// necessary, otherwise all COM interaction will not// function.

CoInitialize(0);try{

// These are the Smart Pointers to the respective Objects// Notice that we can only create an Instance of the Job// Scheduler Smart Pointer. Every other exposed object// in the ActiveBatch COM interface cannot be instantiated// directly. To create an object, for example a Job Object,// you would use the CreateObject() method off of the Job// Scheduler smart pointer.

IAbatJobSchedulerPtr iJss(__uuidof(AbatJobScheduler));

Page 21: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

11

IAbatVariantItemsPtr iVariantItems;IAbatVariantItemPtr iVariantItem;IAbatJobPtr iJob;

DATE dtCurrentDate;SYSTEMTIME stCurrentTime;BSTR bstrData;LCID lcid = ::GetUserDefaultLCID();

// Lets connect to the Local Job ScheduleriJss->Connect(".");

// Lets get today's date in the SYSTEMTIME structure// and convert it to a Variant Time that is needed by the// method GetJobsByDate()GetLocalTime(&stCurrentTime);SystemTimeToVariantTime(&stCurrentTime,&dtCurrentDate);

// This method will return a collection of VariantItem Objects// that have certain information about the Jobs that ran or are// running on the given date.iVariantItems = iJss->GetJobsByDate(dtCurrentDate);

if (iVariantItems->Count > 0){

printf("\r\nThe following are all the jobs that ran/are running today :\r\n");

// Now we can go through the collection and print out the// information for the job. Notice that the loop counter// starts at 1. This is necesary to be compatible with the// Visual Basic constructs.

printf( "\r\n%-20s %-6s %-22s %-s","Job Name","Job ID","StartTime","OnQueue");

printf( "\r\n%-20s %-6s %-22s %-s","--------","------","---------","--------");

for (long i = 1; i <= iVariantItems->Count; i++){

iVariantItem = iVariantItems->Item[_variant_t(i)];

iJob = iJss->GetJob(iVariantItem->Job_JobID);

// Convert the Start Date/Time to a stringVarBstrFromDate( iVariantItem->Job_StartTime,

lcid, LOCALE_NOUSEROVERRIDE,&bstrData);

printf( "\r\n%-20s %-0.6d %-22s %-s",(LPCSTR) iJob->Name,iJob->JobID,(LPCSTR) _bstr_t(bstrData),(LPCSTR) iJob->QueueName);

SysFreeString(bstrData);}

}else{

printf("\r\nThere were no jobs that ran today!");}

printf ("\r\n\r\n");iJss->Disconnect();

}catch (_com_error e){

printf( "An error has occurred while enumerating the Jobs from the JobScheduler.\r\n(0x%x) %s\r\n\r\n",

e.Error(),

Page 22: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

12

e.ErrorMessage());}

CoUninitialize();return 0;

}

Listing 4 – Visual C++ Example for displaying all jobs currently running or have run

Page 23: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

13

2.4 Microsoft Visual Basic Example The ActiveBatch Administrator allows you to see, on any particular day or days, what jobs have or will run. Lets say that you want to have a different view of the system, namely to only see precisely when a particular job or jobs will execute. This example will allow you to do this.

To execute the sample, the following steps will need to be taken. First, launch the Visual Basic IDE. Then choose the “Standard EXE” from the New Project wizard. An default application will be created with an empty Form will appear. Using the Project/References menu, choose to include the “ActiveBatch 3.0 Type Library.” This will allow you to access the ActiveBatch COM layer. Using the Project/Components menu, choose to include the “Microsoft Calendar Control 8.0” and “Microsoft Windows Common Controls 6.0 (SP3).” The versions of the controls may differ depending on which version you have installed. The Calendar Control allows us to have the Calendar view and the Common Controls will give us the ListViews as seen in Figure 1. The next step is to place the controls on the form as seen in Figure 1. The names of the controls can remain the same except for the two (2) buttons, which should be renamed according to Figure 1. Once you have organized the controls on the Form, you can paste the code from Listing 5 into the code for the Form (replace any existing code that was previously there).

Note: This example was built and tested with Visual Basic 6 Service Pack 3.

Figure 1 – Visual Basic Form Layout Here is the code listing for this example: Option ExplicitDim gObjJss As New AbatJobScheduler

Private Sub Form_Load()On Error GoTo ErrHandler

Page 24: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

14

' This will connect to the Job SchedulergObjJss.Connect (".")

' Lets setup both ListViews...ListView1.HideSelection = FalseListView1.FullRowSelect = TrueListView1.LabelEdit = lvwManualListView1.View = lvwReportListView1.MultiSelect = TrueListView1.ColumnHeaders.Add , , "Job Name"ListView1.ColumnHeaders.Add , , "Job ID"ListView1.ColumnHeaders.Add , , "Queue"

ListView2.HideSelection = FalseListView2.FullRowSelect = TrueListView2.LabelEdit = lvwManualListView2.View = lvwReportListView2.MultiSelect = TrueListView2.ColumnHeaders.Add , , "Job ID"ListView2.ColumnHeaders.Add , , "Date/Time"

' This subroutine will fill the first ListView with' Job Data

Call RefreshListControlExit Sub

ErrHandler:MsgBox "An Error occurred while connecting to the Job Scheduler : " & Err.DescriptionSet gObjJss = NothingEnd

End Sub

Private Sub Form_Unload(Cancel As Integer)gObjJss.Disconnect

End Sub

Sub RefreshListControl()On Error GoTo ErrHandler

Dim objJobs As IAbatJobsDim objJob As IAbatJobDim i As Integer

ListView1.ListItems.Clear

i = 1Set objJobs = gObjJss.GetJobsFor Each objJob In objJobs

ListView1.ListItems.Add i, , objJob.NameListView1.ListItems(i).SubItems(1) = CStr(objJob.JobID)ListView1.ListItems(i).SubItems(2) = objJob.QueueName

i = i + 1NextExit Sub

ErrHandler:MsgBox "An Error occurred while refreshing Job information from the Job Scheduler : "

& Err.DescriptionSet gObjJss = NothingEnd

End Sub

Private Sub Go_Click()

On Error GoTo ErrHandler

Dim i As Integer

Page 25: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

15

Dim j As IntegerDim k As IntegerDim m As IntegerDim item As ListItemDim selectedJobs() As IntegerDim iVarItems As IAbatVariantItemsDim iVarItem As IAbatVariantItemDim visDay As Date

' First, see if any jobs have been selectedi = 1For Each item In ListView1.ListItems

If item.Selected = True Theni = i + 1ReDim Preserve selectedJobs(i)selectedJobs(i) = CInt(item.SubItems(1))

End IfNext

ListView2.ListItems.Clearm = 1

' The calendar control always shows a minimum of 42 days,' so lets go through each visible date and see if the selected' jobs run on those dateFor k = 1 To 42

visDay = MonthView1.VisibleDays(k)Set iVarItems = gObjJss.GetJobsByDate(visDay)

MonthView1.DayBold(visDay) = FalseFor Each iVarItem In iVarItems

For j = LBound(selectedJobs) To UBound(selectedJobs)If iVarItem.Job_JobID = selectedJobs(j) Then

MonthView1.DayBold(visDay) = TrueListView2.ListItems.Add m, , selectedJobs(j)ListView2.ListItems(m).SubItems(1) = CStr(iVarItem.Job_StartTime)

m = m + 1End If

Next jNext

Next

MsgBox "done!"Exit Sub

ErrHandler:MsgBox "An Error occurred while populating Job information into the Calendar : " &

Err.DescriptionSet gObjJss = NothingEnd

End SubPrivate Sub RefreshJobs_Click()

Call RefreshListControlEnd Sub

Listing 5 – VB Example for showing the dates/times when a job(s) will execute

Page 26: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

16

2.5 Microsoft Excel Example This example demonstrates how to access and view the performance counters of the Queues that have been created on a Job Scheduler. This example is very useful in determining how your Job Schedulers are currently performing. Using Excel’s ability to graph data, the example will show two comparison graphs for all of the Queues that are on the Job Scheduler. To run the example below, a few simple steps will have to be taken. First Launch Excel and press the “Design Mode” button on the “Control Box” toolbar (it is usually the first Icon on that toolbar). This will place Excel in design mode where you can put buttons and other controls on the spreadsheet. Now, click the “Command Button” button on the same toolbar. Then simply go to the current sheet and click somewhere near Column A and Row 1. A button with the title “Command Button” should appear. Then double click on the button. Once you do that, a VBA window will appear. Then go to the Tools menu, then References and click the item “ActiveBatch 3.0 Type Library” and click OK. This will allow the spreadsheet to access ActiveBatch Objects. Now just simply copy and paste the code below into the VBA code window (replace the text that is already there). Then, just hit ALT+Q and then click on the “Design Mode” button on the toolbar. Now, if you click the “Command Button” on the spreadsheet it should try to connect to the Job Scheduler on the local machine and perform the analysis.

Note: This example was built and tested with Microsoft Excel 2000.

Before you click the button on the spreadsheet, your screen should look like:

Figure 2 – Microsoft Excel Example (in Design Mode)

Page 27: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

17

Once you have clicked the button, depending on your ActiveBatch configuration, the screen should look like:

Figure 3 – Microsoft Excel Sample results

Here is the code that was used to produce the figures above:

Private Sub CommandButton1_Click()Dim objJss As New AbatJobSchedulerDim objQueues As IAbatQueuesDim objQueue As IAbatQueueDim nColIndex As Integer

Dim objWB As WorkbookDim objWS As WorksheetDim objWSTmp As WorksheetDim objSeries As SeriesDim objChart As ChartObject

Application.DisplayAlerts = FalseSet objWB = Application.Workbooks.Add

Set objWS = objWB.Worksheets.Add(, objWB.Worksheets(objWB.Worksheets.Count))With objWS

.Name = "ActiveBatch Data"

.Cells(2, 1) = "Total # of Jobs"

Page 28: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

18

.Cells(3, 1) = "Jobs Executing"

.Cells(4, 1) = "Jobs Submitted"

.Cells(5, 1) = "Jobs Held"

.Cells(6, 1) = "Jobs Pending"

.Columns.HorizontalAlignment = xlHAlignCenter

.Range("A:A").Font.Bold = True

.Range("A:A").Font.Color = RGB(255, 0, 0)

.Columns("A:A").HorizontalAlignment = xlHAlignLeft

.Columns.ColumnWidth = 20End With

For Each objWSTmp In objWB.WorksheetsIf objWSTmp.Name <> "ActiveBatch Data" Then objWSTmp.Delete

Next

' Connect to the local machine's Job SchedulerobjJss.Connect "."Set objQueues = objJss.GetQueues(abatQQT_All)

nColIndex = 2For Each objQueue In objQueues

If objQueue.Type = abatQT_Execution Or objQueue.Type = abatQT_Generic ThenobjWS.Cells(1, nColIndex) = objQueue.NameobjWS.Cells(1, nColIndex).Font.Color = RGB(0, 0, 255)objWS.Cells(2, nColIndex) = objQueue.JobCountobjWS.Cells(3, nColIndex) = objQueue.JobsExecutingCountobjWS.Cells(4, nColIndex) = objQueue.JobsSubmittedCountobjWS.Cells(5, nColIndex) = objQueue.JobsHeldCountobjWS.Cells(6, nColIndex) = objQueue.JobsPendingCountnColIndex = nColIndex + 1

End IfNext

' This will create the first chartSet objChart = objWS.ChartObjects.Add(5, 90, 400, 200)objChart.Chart.ChartWizard _

Source:=objWS.Range("A1:" & CStr(Chr(65 + nColIndex - 2)) + "6"), _Gallery:=xlColumn, _Format:=3, _PlotBy:=xlColumns, _CategoryLabels:=1, _SeriesLabels:=1, _HasLegend:=1, _Title:="Job Analysis"

For Each objSeries In objChart.Chart.SeriesCollectionWith objSeries

.HasDataLabels = True

.ApplyDataLabels Type:=xlValueEnd With

Next

' This will create the second chartSet objChart = objWS.ChartObjects.Add(5, 295, 400, 200)objChart.Chart.ChartWizard _

Source:=objWS.Range("A1:" & CStr(Chr(65 + nColIndex - 2)) + "6"), _Gallery:=xlColumn, _Format:=6, _PlotBy:=xlRows, _CategoryLabels:=1, _SeriesLabels:=1, _HasLegend:=1, _Title:="Queue Analysis"

For Each objSeries In objChart.Chart.SeriesCollectionWith objSeries

.HasDataLabels = True

.ApplyDataLabels Type:=xlValueEnd With

Next

Page 29: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

19

objJss.DisconnectSet objJss = Nothing

End Sub

Listing 6 – Excel Example to illustrate a performance analysis of ActiveBatch

Page 30: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

20

2.6 Active Server Pages (ASP) Example This example is that of an ASP based website. The site has two pages, one that prompts for login information and server to connect to and the other will enumerate all Queues and Jobs on that server. The code for the first page is below:

<SCRIPT LANGUAGE="JScript">

function CheckInputData(){

if (document.abatForm.server.value != "" &&document.abatForm.username.value != "" &&document.abatForm.password.value != "")return true

else {alert("All fields in the form are required. Please fill them All in.")return false

}}</SCRIPT>

<HTML><TITLE>ActiveBatch ASP Example </TITLE><BODY><h1 align="center"><b><u><font color="#0000FF">ActiveBatch ASP Example </font></u></b></h1><center><TABLE WIDTH="500"><TR><TD>This example demonstrates how to connect to a Job Scheduler, enumerate allof the Queues and finally enumerate all of the active jobs in the ActiveBatchSystem. Please fill in all of the information below so that we can successfullyexecute the example.</TD>

</TR></TABLE>

</center><form action="/ActiveBatch/abatExample.asp"method="post"name="abatForm"onsubmit="return CheckInputData()"><center><table border="1" width="400"><tr><td width="100%"><table border="0" width="100%"><tr><td width="44%"><b>ActiveBatch Job Scheduler :</b></td><td width="56%"><input maxLength="30" name="server" size="27">

</td></tr><tr><td width="44%"><b>Username :</b></td><td width="56%"><input maxLength="30" name="username" size="27">

</td></tr><tr><td width="44%"><b>Password :</b></td><td width="56%"><input maxLength="30" name="password" type="password" value size="27">

</td></tr>

</table><p>

Page 31: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

21

&nbsp;</td></tr><tr><td width="100%"><p align="center"><input name="Submit" type="submit" value="Connect"><input name="Reset" type="reset" value="Clear">

</td></tr>

</table>&nbsp;

</CENTER></form></BODY></HTML>

Listing 7 – ASP Example (Part I) for logging into ActiveBatch This page should resemble something like:

Figure 4 – ASP user Login web page

The second page is where the ActiveBatch interaction occurs. Here is the code for that page: <script Language="VBScript" runat="server"></script><% Option Explicit %><html><head><title>ActiveBatch ASP Example</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>

Page 32: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

22

<body bgcolor="#FFFFFF"><%dim objJssdim objQueuesdim objQueuedim objJobdim objJobs

set objJss = CreateObject("ActiveBatch.AbatJobScheduler")objJss.ConnectCStr(request.form("server")),CStr(request.form("username")),CStr(request.form("password"))

' Get all of the Queues on this Job Schedulerset objQueues = objJss.GetQueues(7)for each objQueue in objQueues

Response.Write "<table border=0 width=900 >"Response.Write "<tr><td width=100 bgcolor=#C0C0C0><b>" + objQueue.Name + "</b></td>"Response.Write "<td bgcolor=#C0C0C0><b>"

if objQueue.Type = 1 then ' Execution queueResponse.Write "Execution Queue"elseif objQueue.Type = 2 then ' Generic queue

Response.Write "Generic Queue"elseif objQueue.Type = 3 then ' OnDemand queue

Response.Write "OnDemand Queue"end if

Response.Write ", " + QueueState(objQueue.State) + "</b></td></tr>"Response.Write "<tr><td width=17% >&nbsp;</td><td width=92% >"Response.write "<TABLE border=1 width=800><th style='background-color: #FFFF99'>Job

Name</th><th style='background-color: #FFFF99'>State</th><th style='background-color:#FFFF99'>Next Scheduled Execution</th>"

set objJobs = objQueue.GetJobs

if objJobs.Count = 0 thenResponse.write "<TR><td colspan=3>There are currently no Jobs on this

Queue</td></tr>"else

for each objJob in objJobsResponse.write "<TR>"Response.write "<TD width=250>" + objJob.Name + "</td>" + "<TD width=200>" +

JobState(objJob.State,objJob.SubState) + "</td>"if objJob.NextScheduledExecutionDateTime = 0.0 then

Response.write "<td>N/A</td>"else Response.write "<td>" + CStr(objJob.NextScheduledExecutionDateTime) +

"</td>"end ifResponse.write "</TR>"

nextend if

Response.write "</TABLE></td></tr>"Response.write "</TABLE><br><br>"

next

Set objJss = Nothing

Function JobState(State, SubState)dim StatusStringdim SubStatusString

If State = 1 Then StatusString = "Executing"If State = 2 Then StatusString ="Pending"If State = 3 Then StatusString = "Held"If State = 4 Then StatusString = "Completed"If State = 5 Then StatusString = "Not Queued"

If SubState = 1 Then SubStatusString = "Executing"If SubState = 2 Then SubStatusString = "Executing Pre"

Page 33: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

23

If SubState = 3 Then SubStatusString = "Executing Post"If SubState = 4 Then SubStatusString = "Queue Busy"If SubState = 5 Then SubStatusString = "Waiting Dependency"If SubState = 6 Then SubStatusString = "Waiting Trigger"If SubState = 7 Then SubStatusString = "Waiting Multiple Instance"If SubState = 8 Then SubStatusString = "Deferred"If SubState = 9 Then SubStatusString = "Success"If SubState = 10 Then SubStatusString = "Failure"If SubState = 11 Then SubStatusString = "Aborted"If SubState = 12 Then SubStatusString = "Paused"

JobState = StatusString + " (" + SubStatusString + ")"End Function

Function QueueState(State)dim StatusString

StatusString = "{ "If State and 1 Then StatusString = StatusString + "Open,"If State and 2 Then StatusString = StatusString + " Close,"If State and 4 Then StatusString = StatusString + " Start,"If State and 8 Then StatusString = StatusString + " Starting,"if State and 16 Then StatusString = StatusString + " Stopping,"If State and 32 Then StatusString = StatusString + "Stop,"

StatusString = Left(StatusString,Len(StatusString)-1)StatusString = StatusString + " }"QueueState = StatusString

End Function

%></body></html>

Listing 8 – ASP Example (Part II) examining the ActiveBatch system

Page 34: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

24

Here is what the output should resemble:

Figure 5 – ASP Sample results

Page 35: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

25

2.7 Microsoft Visual J++ Example In order to use the ActiveBatch COM layer with Microsoft Visual J++, Java wrapper code needs to be generated around the COM layer since Java does not natively communicate with COM components. To run the following example, you must first launch the Visual J++ IDE. Since this example is a Console Application, use the New Project menu option to create a Console Application. This will generate a framework for a simple J++ application. In order to access the ActiveBatch COM layer, you will need to generate a COM wrapper for J++. To do this, choose the Add COM Wrapper menu option from the Project menu. This will present a dialog with all available COM libraries; just click the checkbox next to ActiveBatch 3.0 Type Library. Visual J++ will then automatically generate the Java wrapper classes to interface with ActiveBatch. Now that ActiveBatch has been added to the project, you are now able to access all of ActiveBatch’s objects, methods, and properties just as you would any other Java package.

import activebatch.*;import java.*;import com.ms.com.Variant;

public class Class1{

public static void main (String[] args){

try{

// Create a new Job Scheduler ObjectAbatJobScheduler abatJss = new AbatJobScheduler();Variant varTemp = new Variant();String strTemp;

// Connect to the Job Scheduler on the local// machineabatJss.Connect("venus",varTemp,varTemp,varTemp);

IAbatQueues abatQs = abatJss.GetQueues(enumQueueQueryType.abatQQT_All);

varTemp.VariantClear();

strTemp = "Here are the statistics for all execution Queues on the localmachine:\n\n";

System.out.println(strTemp);

strTemp = "Name\tJob Limit\tExec Cnt.\tPend Cnt.\tTotal Jobs";System.out.println(strTemp);strTemp = "----\t---------\t---------\t---------\t----------";System.out.println(strTemp);for (long i = 1; i <= abatQs.getCount(); i++){

varTemp = new Variant(i);IAbatQueue abatQ = abatQs.getItem(varTemp);

if (abatQ.getType() == enumQueueType.abatQT_Execution){

strTemp = abatQ.getName() +"\t\t" + abatQ.getExecutingJobLimit() +"\t\t" + abatQ.getJobsExecutingCount() +"\t\t" + abatQ.getJobsPendingCount() +"\t\t" + abatQ.getJobCount();

System.out.println(strTemp);}

}

abatJss.Disconnect();}

Page 36: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

26

catch (com.ms.com.ComFailException e){

System.out.println(e.getMessage());}

}}

Listing 9 – Visual J++ example for examining the ActiveBatch system

Depending on your ActiveBatch configuration, similar output to the following should appear:

Here are the statistics for all execution Queues on the local machine:

Name Job Limit Exec Cnt. Pend Cnt. Total Jobs---- --------- --------- --------- ----------Local_EQ 1 0 0 0Super_EQ 1 0 0 0

Page 37: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

27

2.8 WMI Examples

The following Windows Scripting Host (WSH) example demonstrates how to connect to the WMI Provider and query it for all events that ActiveBatch provides. Notice the line that contains "select * from ASCI_ABatJssEvent"

This is how the query is specified from a script. You can further enhance the query to get very specific information.

On error resume Next

set locator = CreateObject("WbemScripting.SWbemLocator")

if err <> 0 thenWScript.Echo Err.Description, Err.Number, Err.Source

end if

' This is where the WMI Query is executedset events = locator.ConnectServer(,"root\default")._

ExecNotificationQuery("select * from ASCI_ABatJssEvent")

if err <> 0 thenWScript.Echo Err.Description, Err.Number, Err.Source

end if

' Note this next call will wait indefinitely - a timeout can be specified

WScript.Echo "Waiting for JSS Events..."WScript.Echo ""

doset JSSEvent = events.nexteventif err <> 0 then

WScript.Echo Err.Number, Err.Description, Err.SourceExit Do

elseif JSSEvent.EventMachine <> Empty thenWScript.Echo CStr(Jssevent.eventtype) + " " + JSSEvent.EventMachine + " " +

jssevent.queuenameelse

Wscript.Echo "Event received, but it did not contain a message."end if

loop

WScript.Echo "finished"

Listing 10 – WMI Sample Query for All ActiveBatch Events

The sample below demonstrates how to query ActiveBatch only for the Job Added events. Notice that only the query was modified with where EventType=50 (the Event Type of 50 is the Job Added event). On error resume Next

set locator = CreateObject("WbemScripting.SWbemLocator")

if err <> 0 thenWScript.Echo Err.Description, Err.Number, Err.Source

end if

' This is where the WMI Query is executedset events = locator.ConnectServer(,"root\default")._

ExecNotificationQuery("select * from ASCI_ABatJssEvent where EventType=50")

Page 38: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

28

if err <> 0 thenWScript.Echo Err.Description, Err.Number, Err.Source

end if

' Note this next call will wait indefinitely - a timeout can be specified

WScript.Echo "Waiting for JSS Events..."WScript.Echo ""

doset JSSEvent = events.nexteventif err <> 0 then

WScript.Echo Err.Number, Err.Description, Err.SourceExit Do

elseif JSSEvent.EventMachine <> Empty thenWScript.Echo CStr(Jssevent.eventtype) + " " + JSSEvent.EventMachine + " " +

jssevent.queuenameelse

Wscript.Echo "Event received, but it did not contain a message."end if

loop

WScript.Echo "finished"

Listing 11 – WMI Sample Query for Job Added Events

Page 39: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

29

3 ActiveBatch Developer’s Reference

The sections that follow allow scriptwriters as well as Visual C++ and Visual Basic engineers to access ActiveBatch’s objects, methods and properties. Following Microsoft’s standards, each section uses the Interface Object name as a heading. Detailed for each Object are the methods and properties that have been exposed. The syntax for the invocation of each method has also been defined. Note that all ActiveBatch Objects have been prefixed with “Abat,” (e.g. AbatJobScheduler, AbatJob, AbatQueue,etc.).

Note: All string data used in ActiveBatch is UNICODE based.

Page 40: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

30

3.1 AbatJobScheduler Object This object represents a single Job Scheduler system. The Job Scheduler is the “root” of the ActiveBatch system and all the other objects connect in some fashion to this one. To create this object, you need to issue a CreateObject call using the string “ActiveBatch.AbatJobScheduler”.

For example: Dim Obj

Set Obj = CreateObject(“ActiveBatch.AbatJobScheduler”)

The variable “obj” now contains the AbatJobScheduler object.

Table 1 denotes the methods of this object. Table 2 denotes the properties of this object.

Method Description

AddCalendar Add a Calendar

AddJob Add a Job (or Submit)

AddQueue Add a Queue

AddSchedule Add a Schedule

Connect Connect to Job Scheduler machine (note: machine-spec may be a name, FQDN or IP address)

Create ActiveBatch objects CreateObject DBPurge Run the DBPurge Process

Disconnect Disconnect existing connection to Job Scheduler machine

GetCalendar Get a Calendar object

GetCalendars Get a collection of Calendar object(s)

GetErrorDescription Get the string representation of an error code reported by ActiveBatch

GetJob Get a Job object

GetJobPolicies Get a collection of Job Policy object(s)

GetJobPolicy Get a Job Policy object

GetJobPolicySecurityAccounts Get a collection of default Job Security object(s)

GetJobs Get a collection of Job object(s)

GetJobByDate Get a collection of Job object(s) for a specified date

GetQueue Get a Queue object

GetQueuePolicies Get a collection of Queue Policy object(s)

GetQueuePolicy Get a Queue Policy object

Page 41: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

31

Method Description

GetQueuePolicySecurityAccounts Get a collection of default Queue Security object(s)

GetQueues Get a collection of Queue object(s)

GetSchedule Get a Schedule object

GetSchedulePolicySecurityAccounts Get a collection of default Schedule Security object(s)

GetSchedules Get a collection of Schedule object(s)

GetSystemPolicies Get a collection of System Policy object(s)

GetSystemPolicy Get a System Policy object

GetSystemSecurityAccounts Get a collection of System Security object(s)

IsAdministrator Is the user an ActiveBatch Administrator?

IsConnected Are we currently connected to a Job Scheduler?

Update Update the Job Scheduler object

UpdateCounters Refresh Job Scheduler Performance Counters

Table 1 - AbatJobScheduler Methods

Page 42: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

32

The following table describes each object (in the order of most likely use), and the object’s properties and methods. They pertain to the currently connected Job Scheduler Object.

Property Name Description

ExecutionQueueCount (Long) Number of Execution Queues

GenericQueueCount (Long) Number of Generic Queues

IPAddress (String) Machine’s IP address

JobCount (Long) Total Jobs

JobsCompletedCount (Long) Jobs completed count

JobsExecutingCount (Long) Jobs currently executing

JobsHeldCount (Long) Jobs currently held

JobsPendingCount (Long) Jobs currently pending

JobsSubmittedCount (Long) Jobs currently in the Active System

Name (String) Machine’s name

OS (String) Operating system name

OSBuildNumber (String) Operating system build number

OSServicePack (String) Operating system service pack

OSType (String) Operating system type (i.e. Server)

OSVersion (String) Operating system version

ProductEdition (String) ActiveBatch Product Edition

ProductFileVersion (String) ActiveBatch Product File Version

ProductServicePack (String) ActiveBatch Service Pack

ProductVersion (String) ActiveBatch Version

QueueCount (Long) Total Queues in system

WhoAmI (String) Username you connected with

Table 2 - AbatJobScheduler Properties

Page 43: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

33

3.1.1 AddCalendar Method The AddCalendar method causes a Calendar object to be added to the ActiveBatch system. The Calendar object is associated with a job and is used to determine what valid business days a recurring job may run.

Syntax objJobScheduler.AddCalendar (CalendarToAdd)

Element Description

CalendarToAdd (AbatCalendar) The Calendar object to add.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 3 - AddCalendar Method

3.1.2 AddJob Method The AddJob method causes a Job object to be added to the ActiveBatch system. Users will consider this analogous to job submission. You invoke this method to add a Job to the ActiveBatch system. The Job object’s properties must be set with whatever values you need for proper job execution. The Queue Name specified must already be present on the Job Scheduler system.

Syntax objJobScheduler.AddJob (QueueName, JobToAdd)

Element Description

QueueName (String) The name of the queue to which this job is to be added (e.g., “OnDemand”).

JobToAdd (AbatJob) The Job object to add.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 4 - AddJob Method

Page 44: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

34

3.1.3 AddQueue Method The AddQueue method causes a Queue (Generic or Execution) object to be added to the ActiveBatch system. You must have access permissions to create an ActiveBatch queue.

Syntax objJobScheduler.AddQueue (QueueToAdd)

Element Description

QueueToAdd (AbatQueue) The Queue object to add.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 5 - AddQueue Method

3.1.4 AddSchedule Method The AddSchedule method causes a Schedule object to be added to the ActiveBatch system. The Schedule object is used to denote what days and times a job is to run on a recurring basis.

Syntax objJobScheduler.AddSchedule (ScheduleToAdd)

Element Description

ScheduleToAdd (AbatSchedule) The Schedule object to add

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 6 - AddSchedule Method

Page 45: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

35

3.1.5 Connect Method The Connect method is used to associate a Job Scheduler object with an active Job Scheduler machine. Once a communication path exists between the client and the Job Scheduler, you may issue any of the valid methods that are suitable for each object.

Syntax objJobScheduler.Connect (JobScheduler, [Username], [Password], [SavePassword])

Element Description

JobScheduler (String) The name of the Job Scheduler to connect to.

Username (String) The username under which the connection is to be authenticated. If specified, the username must be valid and exist from the Job Scheduler’s perspective (i.e., either a local account or a domain account). If omitted, then your current Windows 2000/NT logon authentication credentials are used.

Password (String) If specified this password must be valid when coupled with the Username parameter. If omitted and Username is specified, a search of the password list is undertaken to determine whether a stored ActiveBatch LSA password should be used. If so, that password is used.

SavePassword (Boolean) If specified as TRUE, the specified Password is stored in the password list. If specified as FALSE, any password for this Username is deleted from the password list. If omitted, the search for the password is performed, however, no password is stored in the password list.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 7 - Connect Method

Page 46: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

36

3.1.6 CreateObject Method The CreateObject method is used to create all objects (except the initial AbatJobScheduler object) within the ActiveBatch system. Please note that ActiveBatch’s object model requires that this CreateObject be used to properly initialize ActiveBatch objects.

Syntax newObject = objJobScheduler.CreateObject (ObjectType)

Element Description

NewObject The desired object is returned on a successful invocation of this method. The following are the possible objects :

• = AbatCalendar • = AbatJobEventTrigger

• = AbatCharacteristic • = AbatJobNotification

• = AbatQueue • = AbatSecurityAccount

• = AbatJob • = AbatSchedule

• = AbatJobDependency • = AbatVariantItem

• = AbatJobAlert

ObjectType (String) Specifies the name of the object to be created. This value can be one of the following :

• = Calendar • = JobAlert

• = Characteristic • = JobEventTrigger

• = ExecutionQueue • = JobNotification

• = GenericQueue • = SecurityAccount

• = Job • = Schedule

• = JobDependency • = VariantItem

ObjJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that

the method is to operate on.

Table 8 - CreateObject Method

Page 47: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

37

3.1.7 DBPurge Method The DBPurge method is used to initiate the DB Purge process.

Syntax objJobScheduler.DBPurge

Element Description

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 9 - DBPurge Method

3.1.8 Disconnect Method The Disconnect method is used to disconnect a JobScheduler object from an active Job Scheduler machine.

Syntax objJobScheduler.Disconnect

Element Description

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 10 - Disconnect Method

Page 48: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

38

3.1.9 GetCalendar Method The GetCalendar method is used to lookup a specific business calendar.

Syntax objCalendarObject = objJobScheduler.GetCalendar (CalendarName)

Element Description

objCalendarObject (AbatCalendar) The Calendar object that will be filled in with the requested Calendar’s information.

CalendarName (String) The name of the Calendar to be retrieved.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 11 - GetCalendar Method

3.1.10 GetCalendars Method The GetCalendars method is used to retrieve all Calendar objects in the ActiveBatch system.

Syntax objCalendarObjects = objJobScheduler.GetCalendars

Element Description

objCalendarObjects (AbatCalendars) Will contain a collection of Calendar Objects.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 12 - GetCalendars Method

Page 49: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

39

3.1.11 GetErrorDescription Method The GetErrorDescription method is used to lookup a specific error code that was reported by the ActiveBatch system. It will return a string representation of the what the error means.

Syntax String = objJobScheduler. GetErrorDescription (ErrorCode, ErrorCodeType)

Element Description

ObjJobObject (AbatJob) If successful, this will contain a Job Object that corresponds to the “item” parameter.

ErrorCode (unsigned Long) This parameter is the error code that will be looked up in the ActiveBatch system.

ErrorCodeType (abatErrorCodeType) This parameter will receive the type of error that the error code represents.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 13 - GetErrorDescription Method

Page 50: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

40

3.1.12 GetJob Method The GetJob method is used to lookup a specific job in the ActiveBatch system.

Syntax objJobObject = objJobScheduler.GetJob(Item, [GetJobTemplate])

Element Description

ObjJobObject (AbatJob) If successful, this will contain a Job Object that corresponds to the “item” parameter.

Item (Variant) This parameter can be a String or a Long. If the parameter is a String then it is assumed to represent a Job Name and ActiveBatch will search for the first Job whose name matches the specified string. If the parameter is a Long then it is assumed to represent a Job ID. Since Job ID is unique, no ambiguity within this search exists.

GetJobTemplate (Boolean) If specified, a TRUE value means that the Job’s template should be retrieved, if it exists. If a FALSE value is specified (this is the default when omitted), only the active job is retrieved.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 14 - GetJob Method

Page 51: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

41

3.1.13 GetJobPolicies Method The GetJobPolicies method is used to retrieve all the policies concerning jobs and returns a JobPolicy collection. A policy represents a default value for a property.

Syntax objJobPolicies = objJobScheduler.GetJobPolicies

Element Description

objJobPolicyObjects (AbatPolicies) Will contain a collection of Policy Objects.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 15 - GetJobPolicies Method

3.1.14 GetJobPolicy Method The GetJobPolicy method is used to retrieve a specific Job Policy object.

Syntax objJobPolicy = objJobScheduler.GetJobPolicy (JobPolicyName)

Element Description

objJobPolicy (AbatPolicy) Will contain a Job Policy Object that corresponds to the Name requested.

JobPolicyName (String) Specifies the name of the Job Policy Object to retrieve

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 16 - GetJobPolicy Method

Page 52: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

42

3.1.15 GetJobPolicySecurityAccounts Method The GetJobPolicySecurityAccounts method is used to retrieve the default Job security accounts that are used when a new Job is created.

Syntax objSecurityAccounts = objJobScheduler.GetJobPolicySecurityAccounts

Element Description

objSecurityAccounts (AbatSecurityAccounts) Will contain a collection of Job Policy Security Account Objects.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 17 - GetJobPolicySecurityAccounts Method

3.1.16 GetJobs Method The GetJobs method is used to retrieve all Jobs within the ActiveBatch system into a collection of AbatJob object(s).

Syntax objJobs = objJobScheduler.GetJobs

Element Description

ObjJobs (AbatJobs) Will contain a collection of Job Objects. This collection will be all the active jobs on the system.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 18 - GetJobs Method

Page 53: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

43

3.1.17 GetJobsByDate Method The GetJobsByDate method is used to retrieve one or more Job objects that are currently scheduled to run on a specific date.

Syntax objJobVariantItems = objJobScheduler.GetJobsByDate (DateRequested)

Element Description

ObjJobVariantItems (AbatVariantItems) Will contain a collection of Variant Item Objects. This collection will be all jobs on the system for the date requested. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = Job_JobID

• = Job_StartTime

• = Job_EndTime

DateRequested (Date) The date portion of this parameter is used to determine which jobs are scheduled to execute on the specified date.

ObjJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 19 - GetJobsByDate Method

3.1.18 GetQueue Method The GetQueue method is used to retrieve a specific named Queue.

Syntax objQueue = objJobScheduler.GetQueue(QueueName)

Element Description

ObjQueue (AbatQueue) Will contain a Queue Object that corresponds to the QueueName requested.

QueueName (String) Specifies the name of the requested Queue.

ObjJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 20 - GetQueue Method

Page 54: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

44

3.1.19 GetQueuePolicies Method The GetQueuePolicies method is used to retrieve all the policies concerning Queues and returns a QueuePolicy collection. A policy represents a default value for a property.

Syntax objQueuePolicies = objJobScheduler.GetQueuePolicies

Element Description

objQueuePolicies (AbatPolicies) Will contain a collection of Queue Policy Objects.

ObjJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 21 - GetQueuePolicies Method

3.1.20 GetQueuePolicy Method The GetQueuePolicy method is used to retrieve a specific Queue Policy object.

Syntax objQueuePolicy = objJobScheduler.GetQueuePolicy (QueuePolicyName)

Element Description

objQueuePolicy (AbatPolicy) Will contain a Queue Policy Object that corresponds to the QueuePolicyName parameter.

QueuePolicyName (String) Specifies the name of the Policy to retrieve.

ObjJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 22 - GetQueuePolicy Method

Page 55: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

45

3.1.21 GetQueuePolicySecurityAccounts Method The GetQueuePolicySecurityAccounts method is used to retrieve the default Queue security accounts that are used when a new Queue is created.

Syntax objSecurityAccounts = objJobScheduler.GetQueuePolicySecurityAccounts

Element Description

objSecurityAccounts (AbatSecurityAccounts) Will contain a collection of Queue Policy Security Account Objects.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 23 - GetQueuePolicySecurityAccounts Method

3.1.22 GetQueues Method The GetQueues method is used to retrieve all Queues within the ActiveBatch system into a collection of AbatQueue object(s).

Syntax objQueues = objJobScheduler.GetQueues (QueueQueryType)

Element Description

ObjQueues (AbatQueues) Will contain a collection of Queue Objects that correspond to the QueueQueryType.

QueueQueryType (enumQueueQueryType) Specifies the type of Queue requested. You can OR the constants to get different Queues (e.g., objJobScheduler.GetQueues(abatQT_Execution or abatQT_Generic)

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 24 - GetQueues Method

Page 56: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

46

3.1.23 GetSchedule Method The GetSchedule method is used to retrieve a specific named Schedule.

Syntax objSchedule = objJobScheduler.GetSchedule (Item)

Element Description

ObjSchedule (AbatSchedule) Will contain a Schedule Object that corresponds to the Item parameter.

Item (Variant) If this parameter is passed as a String then the name of the Schedule is used for the lookup. If this parameter is passed as a Long then the Schedule ID is used for the lookup.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 25 - GetSchedule Method

3.1.24 GetSchedulePolicySecurityAccounts Method The GetSchedulePolicySecurityAccounts method is used to retrieve the default Schedule security accounts that are used when a new Schedule is created.

Syntax objSecurityAccounts = objJobScheduler.GetSchedulePolicySecurityAccounts

Element Description

objSecurityAccounts (AbatSecurityAccounts) Will contain a collection of Schedule Policy Security Account Objects.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 26 - GetSchedulePolicySecurityAccounts Method

Page 57: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

47

3.1.25 GetSchedules Method The GetSchedules method is used to retrieve all public Schedules into a collection of AbatSchedule object(s).

Syntax objSchedules = objJobScheduler.GetSchedules

Element Description

ObjSchedules (AbatSchedules) Will contain a collection of Schedules that exist on the Job Scheduler.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 27 - GetSchedules Method

3.1.26 GetSystemPolicies Method The GetSystemPolicies method is used to retrieve all the policies concerning the ActiveBatch system itself and returns a SystemPolicy collection. A policy represents a default value for a property.

Syntax objSystemPolicies = objJobScheduler.GetSystemPolicies

Element Description

objSystemPolicies (AbatPolicies) Will contain a collection of System Policy Objects.

ObjJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 28 - GetSystemPolicies Method

Page 58: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

48

3.1.27 GetSystemPolicy Method The GetSystemPolicy method is used to retrieve a specific System Policy object.

Syntax objSystemPolicy = objJobScheduler.GetSystemPolicy (SystemPolicyName)

Element Description

objSystemPolicy (AbatPolicy) Will contain a System Policy Object that corresponds to the SystemPolicyName parameter.

SystemPolicyName (String) Specifies the name of the Policy to retrieve.

ObjJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 29 - GetSystemPolicy Method

3.1.28 GetSystemSecurityAccounts Method The GetSystemSecurityAccounts method is used to retrieve the accounts of the ActiveBatch Administrators and Queue Creators.

Syntax objSecurityAccounts = objJobScheduler.GetSystemSecurityAccounts

Element Description

objSecurityAccounts (AbatSecurityAccounts) Will contain a collection of System Security Account Objects.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 30 - GetSystemSecurityAccounts Method

Page 59: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

49

3.1.29 IsAdministrator Method The IsAdministrator method is used to programmatically determine whether the client is an ActiveBatch Administrator.

Syntax TrueOrFalse = objJobScheduler.IsAdministrator

Element Description

TrueOrFalse (Boolean) If successful, a TRUE indication means that the currently connected user is an ActiveBatch Administrator otherwise a FALSE is returned.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 31 - IsAdministrator Method

3.1.30 IsConnected Method The IsConnected method is used to programmatically determine whether the object is currently connected to a Job Scheduler.

Syntax TrueOrFalse = objJobScheduler.IsConnected

Element Description

TrueOrFalse (Boolean) If successful, a TRUE indication means that the objJobScheduler Object is currently connected to a Job Scheduler, otherwise a FALSE is returned.

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 32 - IsConnected Method

Page 60: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

50

3.1.31 Update Method The Update method is used to signal that any changes made to any Job Scheduler objects are to now actually take place. For performance reasons, property changes to an object are cached and no actual changes are made until this method (for AbatJobScheduler sub-objects) is issued.

Syntax objJobScheduler.Update

Element Description

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 33 - Update Method

3.1.32 UpdateCounters Method The UpdateCounters method is used to request a refresh of the Job Scheduler’s performance counters.

Syntax objJobScheduler.UpdateCounters

Element Description

objJobScheduler (AbatJobScheduler) This object represents the Job Scheduler that the method is to operate on.

Table 34 - UpdateCounters Method

Page 61: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

51

3.2 AbatQueue Object This object represents a single Queue. The object is created through the CreateObject method from the AbatJobScheduler object.

Table 34 denotes all the methods associated with this object. Table 35 denotes all the properties associated with this object.

Method Description

Close Close a Queue

Delete Delete a Queue

Flush Flush a Queue

GetAssociatedExecutionQueues Retrieve all Execution Queues (Generic Queue)

GetExecutionMachineCharacteristics Retrieve all Machine characteristic objects

GetJobs Get Jobs on Queue

GetSecurityAccounts Get Security Accounts for Queue

GetUserCharacteristics Retrieve all User characteristics

Open Open a Queue

Start Start a Queue

Stop Stop a Queue

TakeOwnership Take Ownership of a Queue

Update Update modified Queue object

UpdateCounters Refresh Queue Performance Counters

Table 35 - AbatQueue Methods

Property Name Description

Algorithm (enumQueueAlgorithmType) Generic Queue Scheduling Algorithm

CloseTime (Date) Time for Queue to Close

CustomEventLogLocation (String) Machine name for Windows 2000/NT Event Log location

DefaultOSPriority (String) Default O/S Job Scheduling Priority

DefaultQueuePriority (Long) Default ActiveBatch Job Queue Priority

Description (String) Description of Queue

EnableDefaultHoldOnError (Boolean) Default Job Hold on Error

Page 62: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

52

Property Name Description

EnableEventLogging (Boolean) Enable Start/Stop Event Logging

EnableOpenCloseTime (Boolean) Enable Open/Close Time

EnableStartStopTime (Boolean) Enable Start/Stop Time

EventLogLocation (enumQueueEventLogType) If enabled, indicates which NT Event Log should be used

ExecutingJobLimit (Long) Maximum number of Jobs which may execute simultaneously

ExecutionMachine (String) Execution Machine name

ExecutionMachineConnectCount (Long) Number of Job Scheduler’s connecting to Execution Machine

JobCount (Long) Total number of Jobs on queue

JobsCPUOverrunCount (Long) Total number of jobs who have overrun on CPU since last started

JobsDateTimeTriggeredCount (Long) Total number of jobs who have been triggered into execution due to date/time since last started

JobsDependencyFailCount (Long) Total number of jobs who have had a dependency fail since last started

JobsElapsedOverrunCount (Long) Total number of jobs who have overrun on elapsed time since last started

JobsEventTriggeredCount (Long) Total number of jobs who have been triggered into execution due to an event since last started

JobsExecutingCount (Long) Number of jobs currently executing

JobsHeldCount (Long) Total number of jobs in Hold state

JobsLateCompletionCount (Long) Total number of jobs who have completed past due since last started

JobsLateStartCount (Long) Total number of jobs who have been started late past scheduled time since last started

JobsPendingCount (Long) Number of jobs in Pending state

JobsRestartedCount (Long) Total number of jobs who have been restarted since last started

JobsSubmittedCount (Long) Total number of jobs that have been submitted to queue since last started

JobsTriggeredCount (Long) Total number of jobs which have been triggered (by operation) since last started

Name (String) Queue Name. Must be unique.

OpenTime (Date) Time portion for queue open

Page 63: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

53

Property Name Description

Owner (String) Owner account specification for Queue’s owner

StartTime (Date) Time portion for queue start

State (enumQueueState) Queue’s operational state

StopTime (Date) Time portion for queue stop

Type (enumQueueType) Type of Queue

WorkingDirectory (String) Device and directory specification appropriate to Execution Agent as default for Job Submission

Table 36 - AbatQueue Properties

Page 64: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

54

3.2.1 Close Method The Close method is used to close a Queue. A Queue that is closed cannot accept job submissions.

Syntax objQueue.Close

Element Description

ObjQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 37 - Close Method

3.2.2 Delete Method The Delete method is used to delete a Queue. Before you can delete a Queue, no Jobs may be active or present on the Queue. This method allows you to flush and abort any present/active jobs through the FlushQueueFirst parameter.

Syntax objQueue.Delete (FlushQueueFirst)

Element Description

FlushQueueFirst (Boolean) If TRUE, any Jobs on the Queue are flushed or aborted. The Queue is then deleted. If FALSE is specified, then if there are jobs on this Queue, this method will fail.

ObjQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 38 - Delete Method

Page 65: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

55

3.2.3 Flush Method The Flush method is used to flush all jobs that may be found on a Queue.

Syntax objQueue.Flush

Element Description

objQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 39 - Flush Method

3.2.4 GetAssociatedExecutionQueues Method The GetAssociatedExecutionQueues method is used to lookup all Execution Queues that have been associated with this Generic Queue. This method will produce an error if used on an Execution Queue. The result returned is an AbatQueues collection object.

Syntax objQueues = objQueue.GetAssociatedExecutionQueues

Element Description

objQueues (AbatQueues) If successful, a collection of Associated Execution Queues will be returned.

objQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 40 - GetAssociatedExecutionQueues Method

Page 66: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

56

3.2.5 GetExecutionMachineCharacteristics Method The GetExecutionMachineCharacteristics method is used to lookup all Execution Machine characteristics that have been associated with this Execution Queue. An error will result if this method is invoked on a Generic Queue.

Syntax objCharacteristics = objQueue.GetExecutionMachineCharacteristics

Element Description

objCharacteristics (AbatCharacteristics) If successful, a collection of Execution Machine Characteristics will be returned.

objQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 41 - GetExecutionMachineCharacteristics Method

3.2.6 GetJobs Method The GetJobs method is used to lookup all Jobs that are present on a given Queue. Don’t confuse this method with one associated with the AbatJobScheduler object that allows a complete system wide enumeration.

Syntax objJobs = objQueue.GetJobs

Element Description

objJobs (AbatJobs) If successful, a collection of Jobs that are on the Queue will be returned.

objQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 42 - GetJobs Method

Page 67: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

57

3.2.7 GetSecurityAccounts Method The GetSecurityAccounts method is used to retrieve the accounts of those associated with the given Queue.

Syntax objSecurityAccounts = objQueue.GetSecurityAccounts

Element Description

objSecurityAccounts (AbatSecurityAccounts) If successful, a collection of Security Accounts will be returned.

objQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 43 - GetSecurityAccounts Method

3.2.8 GetUserCharacteristics Method The GetUserCharacteristics method is used to lookup all User characteristics associated with the Execution Queue. An error will result if this method is invoked on a Generic Queue.

Syntax objCharacteristics = objQueue.GetUserCharacteristics

Element Description

objCharacteristics (AbatCharacteristics) If successful, a collection of User Characteristics will be returned.

objQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 44 - GetUserCharacteristics Method

Page 68: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

58

3.2.9 Open Method The Open method is used to open a Queue. A Queue that is open can accept job submissions.

Syntax objQueue.Open

Element Description

objQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 45 - Open Method

3.2.10 Start Method The Start method is used to start a Queue. A Queue that is started allows its jobs to execute.

Syntax objQueue.Start

Element Description

objQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 46 - Start Method

Page 69: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

59

3.2.11 Stop Method The Stop method is used to stop a Queue. A Queue that is stop cannot execute any jobs.

Syntax objQueue.Stop

Element Description

ObjQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 47 - Stop Method

3.2.12 TakeOwnership Method The TakeOwnership method is used to change the Owner property of a Queue. The user issuing the method takes ownership. The owner cannot be specified.

Syntax objQueue.TakeOwnership

Element Description

ObjQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 48 - TakeOwnership Method

Page 70: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

60

3.2.13 Update Method The Update method is used to update any properties that were changed for this Queue.

Syntax objQueue.Update

Element Description

ObjQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 49 - Update Method

3.2.14 UpdateCounters Method The UpdateCounters method is used to refresh the Queue object performance counters.

Syntax objQueue.UpdateCounters

Element Description

ObjQueue (AbatQueue) This object represents the Queue that the method is to operate on.

Table 50 - UpdateCounters Method

Page 71: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

61

3.3 AbatQueues Object This object represents a collection of AbatQueue objects. The tables below represent the specific methods and properties for this collection object. This collection object also supports Visual Basic’s FOR…EACH syntax.

Method Description

Add Add a Queue

Remove Remove a Queue

Table 51 - AbatQueues Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatQueue) Queue object also accessible via Item(index)

Table 52 - AbatQueues Properties

Page 72: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

62

3.3.1 Add Method The Add method is used to add a Queue object to the ActiveBatch system.

Syntax objQueues.Add (QueueToAdd)

Element Description

QueueToAdd (AbatQueue) This object represents the Queue that will be added to the collection.

ObjQueues (AbatQueues) This object represents the Queues collection that the method is to operate on.

Table 53 - Add Method

3.3.2 Remove Method The Remove method is used to remove a Queue object.

Syntax objQueues.Remove (SearchType, Item, [FlushQueueFirst])

Element Description

SearchType (enumSearchType) You may specify an Index, which represents the Queue object number within the collection object, OR you may specify the Queue Name you are interested in removing.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove. If SearchType is abatST_Key, then this should be a String referring to the name of the Queue that you want to delete.

FlushQueueFirst (Boolean) If TRUE, then jobs on the specifies Queue are delete, otherwise if the parameter is FALSE, or it is omitted, then if there are jobs on the Queue, the method will fail.

objQueues (AbatQueues) This object represents the Queues collection that the method is to operate on.

Table 54 - Remove Method

Page 73: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

63

3.4 AbatPolicy Object This object governs the general policy setting for various ActiveBatch objects. A “Policy” typically represents a default value for an object’s property and also an indication as to whether the default value can be changed by a non ActiveBatch Administrator. Currently, ActiveBatch provides policies for Queue and Job objects as well as the ActiveBatch System.

Method Description

Update Update the object

Table 55 - AbatPolicy Methods

Property Name Description

Description (String) Policy Description

DisplayValue (String) String representation of the value given by the Value property

EnableLock (Boolean) If TRUE, the default value is locked and cannot be changed by a non-administrator. If FALSE, the default value can be changed by anyone.

Name (String) Policy name.

Type (enumPolicyType) Data type of policy Value

Value (Variant) Based on the “Type” the value of the policy

Table 56 - AbatPolicy Properties

Page 74: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

64

3.4.1 Update Method The Update method is used to update any properties that were changed for this Policy.

Syntax objPolicy.Update

Element Description

objPolicy (AbatPolicy) This object represents the Policy that the method is to operate on.

Table 57 – Update Method

Page 75: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

65

3.5 AbatPolicies Object This is a collection object containing AbatPolicy Objects.

This object exposes no special methods.

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatPolicy) Policy object also accessible via Item (index)

Table 58 - AbatPolicies Properties

Page 76: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

66

3.6 AbatSchedule Object This object represents a Schedule. A Schedule is used by one or more recurring jobs to indicate what date and time the job should execute. The Schedule therefore consists of various day, date and time specifications as well as an association of jobs to the schedule.

This object is obtained either through the collection object AbatSchedules (which lists all the Schedules in the system) or through methods using the AbatJobScheduler object or the AbatJob object.

Method Description

CopyObject Create a duplicate of a schedule

Delete Delete a Schedule

GetAssociatedJobs Get the Jobs that are associated with a schedule

GetSecurityAccounts Get Security Account/Access

TakeOwnership Take Ownership of the object

TimeSpec_GetExactTimes Provide Exact (hh:mm) Times

Update Update the object

Table 59 - AbatSchedule Methods

Property Name Description

DaySpec_DailyInterval (Long) Specifies to run the job every XX days

DaySpec_MonthlyDayOfMonth (Long) Specifies which day of the month to run the job

DaySpec_MonthlyDayOfWeek (enumScheduleInstanceDay) Specifies which day of the week to run the job

DaySpec_MonthlyInstance (enumScheduleInstanceType) Specifies the instance of the month to run the job

DaySpec_MonthlyInterval (Long) Specifies to run the job every XX months

DaySpec_MonthlyType (enumScheduleMonthlyType) Specifies the type of Monthly Schedule

DaySpec_Type (enumScheduleDaySpecType) Specifies the type of Day Schedule

DaySpec_WeeklyDaysOfWeek (enumScheduleDays) Specifies the days of the week to run the job

DaySpec_WeeklyInterval (Long) Specifies to run the job every XX weeks

DaySpec_YearlyDayOfMonth (Long) Specifies the day of the month to run the job

Page 77: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

67

Property Name Description

the job

DaySpec_YearlyDayOfWeek (enumScheduleInstanceDay) Specifies the day of the week to run the job

DaySpec_YearlyInstance (enumScheduleInstanceType) Specifies the instance of the year to run the job

DaySpec_YearlyMonthOfYear (enumScheduleMonths) Specifies the which month of the year to run the job

DaySpec_YearlyType (enumScheduleYearlyType) Specifies the type of the Yearly Schedule

Description (String) Description of Schedule

EnablePrivate (Boolean) If TRUE, Schedule is private to one job only. If FALSE, Schedule is public

ID (Long) Schedule ID. Unique.

Name (String) Schedule Name. Unique.

NoEndDate (Boolean) If TRUE, Schedule has no ending date. If FALSE, Schedule has an end date (see RangeSpec_EndDate)

Owner (String) Creator/Owner of Schedule

RangeSpec_EndDate (Date) Ending Date if NoEndDate is false

RangeSpec_StartDate (Date) Effective Starting Date for Schedule (not used before this date)

TimeSpec_Hours (String) List of comma separated hours

TimeSpec_Interval (Long) Interval period that is used to run job (i.e. every 2 hours)

TimeSpec_Minutes (String) List of comma separated minutes

TimeSpec_Type (enumScheduleTimeSpecType) Specifies the type of Time Schedule

Table 60 - AbatSchedule Properties

Page 78: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

68

3.6.1 CopyObject Method The CopyObject method is used to create a duplicate of an existing Schedule.

Syntax objNewSchedule = objSchedule.CopyObject

Element Description

objNewSchedule (AbatSchedule) If successful, this object will contain an exact duplicate of the objSchedule Object.

objSchedule (AbatSchedule) This object represents the Schedule Object that the method is to operate on.

Table 61 - CopyObject Method

3.6.2 Delete Method The Delete method is used to delete a Schedule. When you delete a Schedule there can be no jobs currently associated with the Schedule otherwise an error is produced.

Syntax objSchedule.Delete

Element Description

objSchedule (AbatSchedule) This object represents the Schedule Object that the method is to operate on.

Table 62 - Delete Method

Page 79: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

69

3.6.3 GetAssociatedJobs Method The GetAssociatedJobs method is used to retrieve the Jobs that are associated with the given Schedule.

Syntax objVariantItems = objSchedule.GetAssociatedJobs

Element Description

objVariantItems (AbatVariantItems) If successful, this object will contain a collection of Jobs that are associated with this schedule. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = Job_JobID

objSchedule (AbatSchedule) This object represents the Schedule Object that the method is to operate on.

Table 63 - GetAssociatedJobs Method

3.6.4 GetSecurityAccounts Method The GetSecurityAccounts method is used to retrieve the accounts that are associated with the given Schedule.

Syntax objSecurityAccounts = objSchedule.GetSecurityAccounts

Element Description

objSecurityAccounts (AbatSecurityAccounts) If successful, this object will contain a collection of Security Accounts that are associated with the schedule.

objSchedule (AbatSchedule) This object represents the Schedule Object that the method is to operate on.

Table 64 - GetSecurityAccounts Method

Page 80: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

70

3.6.5 TakeOwnership Method The TakeOwnership method is used to change the Owner property of a Schedule. The user issuing the method takes ownership. The owner cannot be specified.

Syntax objSchedule.TakeOwnership

Element Description

objSchedule (AbatSchedule) This object represents the Schedule Object that the method is to operate on.

Table 65 - TakeOwnership Method

3.6.6 TimeSpec_GetExactTimes Method The TimeSpec_GetExactTimes method is used to manipulate a list of exact times that the Job(s) may run.

Syntax objVariantItems = objSchedule.TimeSpec_GetExactTimes

Element Description

objVariantItems (AbatVariantItems) If successful, this object will contain a collection of VariantItem Objects that have Exact Times. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = DateTime

objSchedule (AbatSchedule) This object represents the Schedule Object that the method is to operate on.

Table 66 - TimeSpec_GetExactTimes Method

Page 81: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

71

3.6.7 Update Method The Update method is used to update any properties that were changed for this Schedule.

Syntax objSchedule.Update

Element Description

objSchedule (AbatSchedule) This object represents the Schedule Object that the method is to operate on.

Table 67 - Update Method

Page 82: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

72

3.7 AbatSchedules Object This object represents a collection of AbatSchedule objects. The tables below represent the specific methods and properties for this collection object. This collection object also supports Visual Basic’s FOR…EACH syntax.

Method Description

Add Add a Schedule

Remove Remove a Schedule

Table 68 - AbatSchedules Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatSchedule) Schedule object also accessible via Item (index)

Table 69 – AbatSchedules Properties

Page 83: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

73

3.7.1 Add Method The Add method is used to add a Schedule object to the ActiveBatch system.

Syntax objSchedules.Add (ScheduleToAdd)

Element Description

ScheduleToAdd (AbatSchedule) This object represents the Schedule that will be added to the collection.

objSchedules (AbatSchedules) This object represents the Schedules collection that the method is to operate on.

Table 70 - Add Method

3.7.2 Remove Method The Remove method is used to remove a Schedule object.

Syntax objSchedules.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index, which represents the Schedule object number within the collection object, or you may specify the Schedule Name or the Schedule ID you are interested in removing.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove. If SearchType is abatST_Key, then this should be a String referring to the name of the Schedule that you want to delete. If SearchType is abatST_Key, then this can also be a Long that is the Schedule ID of the Schedule you want to delete.

objSchedules (AbatSchedules) This object represents the Schedules collection that the method is to operate on.

Table 71 - Remove Method

Page 84: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

74

3.8 AbatCalendar Object This object represents the base Calendar object.

Method Description

Delete Delete a Calendar

GetFixedHolidays Returns holidays which have been represented as fixed dates

GetRelativeHolidays Returns holidays which have been represented as self-relative holidays

GetSecurityAccounts Returns collection of security permissions associated with this calendar

TakeOwnership Take Ownership of Calendar

Update Update Calendar

Table 72 -- AbatCalendar Methods

Property Name Description

Description (String) Description of the business calendar

Name (String) Business Calendar Name.

NonBusinessDays (enumScheduleDays) Days listed are “non-business days”

Owner (String) Owner of the calendar

Table 73 -- AbatCalendar Properties

Page 85: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

75

3.8.1 Delete Method The Delete method is used to delete a Calendar. When you delete a Calendar there can be no jobs currently associated with the Calendar otherwise an error is produced.

Syntax objCalendar.Delete

Element Description

objCalendar (AbatCalendar) This object represents the Calendar Object that the method is to operate on.

Table 74 - Delete Method

3.8.2 GetFixedHolidays Method The GetFixedHolidays method is used to retrieve the Fixed Holidays of the Calendar.

Syntax objVariantItems = objCalendar.GetFixedHolidays

Element Description

objVariantItems (AbatVariantItems) If successful, this object will contain a collection of Fixed Holidays that are associated with this Calendar. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = Calendar_FixedHolidayDate

• = Calendar_FixedHolidayDayOfMonth

• = Calendar_FixedHolidayMonthOfYear

• = Calendar_FixedHolidayName

• = Calendar_FixedHolidayType

objCalendar (AbatCalendar) This object represents the Calendar Object that the method is to operate on.

Table 75 - GetFixedHolidays Method

Page 86: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

76

3.8.3 GetRelativeHolidays Method The GetRelativeHolidays method is used to retrieve the Relative Holidays of the Calendar.

Syntax objVariantItems = objCalendar.GetRelativeHolidays

Element Description

objVariantItems (AbatVariantItems) If successful, this object will contain a collection of Relative Holidays that are associated with this Calendar. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = Calendar_RelativeHolidayDayOfWeek

• = Calendar_RelativeHolidayInstance

• = Calendar_RelativeHolidayMonthOfYear

• = Calendar_RelativeHolidayName

objCalendar (AbatCalendar) This object represents the Calendar Object that the method is to operate on.

Table 76 - GetRelativeHolidays Method

3.8.4 GetSecurityAccounts Method The GetSecurityAccounts method is used to retrieve the accounts that are associated with the given Calendar.

Syntax objSecurityAccounts = objCalendar.GetSecurityAccounts

Element Description

objSecurityAccounts (AbatSecurityAccounts) If successful, this object will contain a collection of Security Accounts that are associated with the Calendar.

objCalendar (AbatCalendar) This object represents the Calendar Object that the method is to operate on.

Table 77 - GetSecurityAccounts Method

Page 87: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

77

3.8.5 TakeOwnership Method The TakeOwnership method is used to change the Owner property of a Calendar. The user issuing the method takes ownership. The owner cannot be specified.

Syntax objCalendar.TakeOwnership

Element Description

objCalendar (AbatCalendar) This object represents the Calendar Object that the method is to operate on.

Table 78 - TakeOwnership Method

3.8.6 Update Method The Update method is used to update any properties that were changed for this Calendar.

Syntax objCalendar.Update

Element Description

objCalendar (AbatCalendar) This object represents the Calendar Object that the method is to operate on.

Table 79 - Update Method

Page 88: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

78

3.9 AbatCalendars Object This object represents a collection of AbatCalendar objects. The tables below represent the specific methods and properties for this collection object. This collection object also supports Visual Basic’s FOR…EACH syntax.

Method Description

Add Add a Calendar

Remove Remove a Calendar

Table 80 - AbatCalendars Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatCalendar) Calendar object also accessible via Item(index)

Table 81 - AbatCalendars Methods

Page 89: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

79

3.9.1 Add Method The Add method is used to add a Calendar object to the ActiveBatch system.

Syntax objCalendars.Add (ScheduleToAdd)

Element Description

CalendarToAdd (AbatCalendar) This object represents the Calendar that will be added to the collection.

objCalendars (AbatCalendars) This object represents the Calendars collection that the method is to operate on.

Table 82 - Add Method

3.9.2 Remove Method The Remove method is used to remove a Calendar object.

Syntax objSchedules.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index, which represents the Calendar object number within the collection object, or you may specify the Calendar Name you are interested in removing.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove. If SearchType is abatST_Key, then this should be a String referring to the name of the Calendar that you want to delete.

ObjCalendars (AbatCalendars) This object represents the Calendars collection that the method is to operate on.

Table 83 - Remove Method

Page 90: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

80

3.10 AbatJob Object This object represents the base Job object. A Job object contains several related sub-objects.

Method Description

Abort Abort a Job

CopyObject Copy Job Object

Delete Delete the Job

GetAlerts Get Job Alerts

GetAssociatedSchedules Get Schedules that are associated with this Job

GetAudits Get Job Audit Trail

GetDependencies Get Job Dependencies

GetEventTriggers Get Job Event Triggers

GetExclusionList Get Job Date/Time Exclusion List

GetExecutionMachineCharacteristics Get Job’s Execution Machine Characteristics

GetHistory Get Job History

GetJobFailureStarts Get Job’s Batch Start (Failure)

GetJobSuccessStarts Get Job’s Batch Start (Success)

GetNotifications Get Job’s Notifications

GetSecurityAccounts Get Security Accounts

GetUserCharacteristics Get Job’s User Characteristics

Hold Hold Job

IsJobTemplate Is this Job a Template?

MoveTo Move Job to Queue (Requeue)

Pause Pause Executing Job

ReleaseJob Release a previously Held Job

ResetMonitorCPUTimeAverages Reset CPU Time Averages

ResetMonitorRunTimeAverages Reset Run Time Averages

Restart Restart an Executing Job

Resume Resume a Paused Job

Synchronize Synchronize

TakeOwnership Take Ownership of Job

Trigger Trigger Job for Execution

Update Update Job

Page 91: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

81

Table 84 - AbatJob Methods

Property Name Description

CalendarName (String) Business Calendar Name. If present, date/time scheduled recurring job must conform to calendar

Category (String) Job Category.

ClientMachineName (String) Client (submitter’s) machine name

CPUDeltaTimeDays (Long) This value depends on the value of CPUTimeType. If CPUTimeType is abatJMTT_Percent, then this value is the CPU Percent Delta Time. If CPUTimeType is abatJMTT_DeltaTime, then this value is the CPU allowed delta time in days.

CPUDeltaTimeHours (Long) CPU allowed delta time in hours

CPUDeltaTimeMinutes (Long) CPU allowed delta time in minutes

CPUDeltaTimeSeconds (Long) CPU allowed delta time in seconds

CPUTimeType (enumJobMonitorTimeType) Indicates whether CPU Delta Time is actually delta time or percent

DeferredUntil (Date) Job Execution Deferred until this time

Description (String) Job Description

Documentation (String) Job Documentation reference

EnableAbortCPUTimeOverrun (Boolean) If TRUE, abort job on CPU time overrun

EnableAbortRunTimeOverrun (Boolean) If TRUE, abort job on elapsed time overrun

EnableActiveBatchEventTriggers (Boolean) If TRUE, Trigger command can be used on this job

EnableAutoRestart_OnFailover (Boolean) If TRUE, Job Restart and Failover to another Execution Machine is enabled

EnableAutoRestart_OnProcessFailure

(Boolean) If TRUE, Job Restart in the event the process fails is enabled

EnableAutoRestart_OnReboot (Boolean) If TRUE, Job Restart is enabled for same Execution Machine

EnableCopyJobFile (Boolean) If TRUE, main job file is copied to eventual Execution Machine

EnableCopyPostJobFile (Boolean) If TRUE, post step job file is copied to eventual Execution Machine

EnableCopyPreJobFile (Boolean) If TRUE, pre step job file is copied to eventual Execution Machine

EnableCPUAgainstHistory (Boolean) If TRUE, maintain historical average for CPU time

Page 92: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

82

Property Name Description

EnableCPUTimeMonitor (Boolean) If TRUE, CPU Time monitoring is enabled

EnableEventTriggers (Boolean) If TRUE, Event Triggers are enabled

EnableExpectedCPUTime (Boolean) If TRUE, Expected CPU Time is enabled

EnableExpectedRunTime (Boolean) If TRUE, Expected Run Time is enabled

EnableHoldOnCompletion (Boolean) If TRUE, Hold Job on Completion

EnableHoldJobOnError (Boolean) If TRUE, Hold Job on Error

EnableHoldJobOnSubmit (Boolean) If TRUE, Hold Job on Submit

EnableJobSimulation (Boolean) If TRUE, Job Simulation mode is enabled

EnableLogging (Boolean) If TRUE, Job Output Logging is enabled

EnableLogRetention (Boolean) If TRUE, Log file retention period is enabled

EnablePostJobCompletionFailure (Boolean) If TRUE, Post job step failure results in job termination and failure status

EnablePostJobFile (Boolean) If TRUE, Post job step is enabled

EnablePreJobFile (Boolean) If TRUE, Pre job step is enabled

EnablePrePostSimulation (Boolean) If TRUE, Pre and Post job steps are in simulation mode

EnableProcessorMask (Boolean) If TRUE, processor affinity mask is enabled for multi-processor systems

EnableReadOnly (Boolean) If TRUE, job is set to read only access

EnableRememberPassword (Boolean) If TRUE, remember specified password

EnableRunAgainstHistory (Boolean) If TRUE, run time is used to maintain historical average for Elapsed Time Overrun

EnableRunImmediately (Boolean) If TRUE, run job immediately (can only be used with a recurring job to request immediate execution)

EnableRunOnceOnly (Boolean) If TRUE, job is to be run once regardless of trigger mechanism

EnableRunTimeMonitor (Boolean) If TRUE, Elapsed Time monitoring is enabled

EnableSaveJobHistory (Boolean) If TRUE, Job History information is saved

Page 93: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

83

Property Name Description

EnableSimulateJobRestart (Boolean) If TRUE, simulate Job Restart

EnableStdErrorLogFile (Boolean) If TRUE, standard error logging is enabled

EnableTerminateAllChildren (Boolean) If TRUE, terminate all child processes (Note: Not all operating systems support this feature).

EnableTimerTriggers (Boolean) If TRUE, enable date/time triggers

EnableUseNextBusinessDay (Boolean) If TRUE and a Calendar is specified, the next business day is used when a run date falls on a Holiday

EnableDeltaCPUTimeDays (Boolean) If TRUE, Delta CPU Time Days specified

EnableDeltaCPUTimeHours (Boolean) If TRUE, Delta CPU Time Hours specified

EnableDeltaCPUTimeMinutes (Boolean) If TRUE, Delta CPU Time Minutes specified

EnableDeltaCPUTimeSeconds (Boolean) If TRUE, Delta CPU Time Seconds specified

EnableDeltaRunTimeDays (Boolean) If TRUE, Delta Elapsed Time Days specified

EnableDeltaRunTimeHours (Boolean) If TRUE, Delta Elapsed Time Hours specified

EnableDeltaRunTimeMinutes (Boolean) If TRUE, Delta Elapsed Time Minutes specified

EnableDeltaRunTimeSeconds (Boolean) If TRUE, Delta Elapsed Time Seconds specified

FailAction (enumJobDependentFailActionType) You can indicate whether to fail or wait on the job dependency

GroupName (String) Job Group Name. Used to categorize a set of related jobs

JobFilename (String) Job Filename

JobID (Long) Job ID

JobPostFilename (String) Job Post Step Filename

JobPreFilebname (String) Job Pre Step Filename

LastRunStatus (Long) Last instance’s job exit status

LogFilename (String) Log Filename

LoggingMethod (enumJobLogType) You can indicate whether you want to centrally manage this file or not

MaximumRestarts (Long) Total number of Job Restarts allowed

Page 94: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

84

Property Name Description

allowed

Name (String) Job Name. Not required to be unique but should be

NextScheduledExecutionDateTime (Date) Next computed scheduled execution date/time for this job.

OnJobActiveAction (enumJobOnActionType) If Job instance already active, what processing should ActiveBatch perform

OnJobActiveWaitForDuration (Long) Indicates the extent of time that ActiveBatch should wait for a Job instance to complete

OriginalOwner (String) Original Creator/Owner of job (see Owner for current creator/owner)

OSPriority (String) OS Priority

Owner (String) Current Creator/Owner of Job

Parameters (String) Job Input Parameters

Password (String) User’s password

ProcessorMask (String) Processor Affinity Mask.

QueueName (String) Queue name that job is submitted to or currently on

QueuePriority (String) ActiveBatch Job Queue Priority. This is the job’s priority when queued. This is not the Job’s OS scheduling (or run-time) priority

QueueSelectionMethod (enumJobQSelectionType) Indicates general Generic queue to Execution queue processing

RecurringIntervalDays (Long) Recurring Job Time in interval designation (days)

RecurringIntervalHours (Long) Recurring Job Time in interval designation (hours)

RecurringIntervalMinutes (Long) Recurring Job Time in interval designation (minutes)

RetainLogFileDuration (Long) Retain Log File Retention period

RunDeltaTimeDays (Long) Elapsed Time Delta days

RunDeltaTimeHours (Long) Elapsed Time Delta hours

RunDeltaTimeMinutes (Long) Elapsed Time Delta minutes

RunDeltaTimeSeconds (Long) Elapsed Time Delta seconds

RunTimeType (enumJobMonitorTimeType) Time or Percent for RunDeltaTime properties

SaveJobHistoryDuration (Long) Retain Job History period

Page 95: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

85

Property Name Description

SimulatedDeltaCPUTimeDays (Long) Simulated CPU Time Delta days

SimulatedDeltaCPUTimeHours (Long) Simulated CPU Time Delta hours

SimulatedDeltaCPUTimeMinutes (Long) Simulated CPU Time Delta minutes

SimulatedDeltaCPUTimeSeconds (Long) Simulated CPU Time Delta seconds

SimulatedDeltaRunTimeDays (Long) Simulated Delta Time Elapsed Run days

SimulatedDeltaRunTimeHours (Long) Simulated Delta Time Elapsed Run hours

SimulatedDeltaRunTimeMinutes (Long) Simulated Delta Time Elapsed Run minutes

SimulatedDeltaRunTimeSeconds (Long) Simulated Delta Time Elapsed Run seconds

SimulateJobExitCode (Long) Simulated Job Exit Code

SimulatePostExitCode (Long) Simulated Post Step Exit Code

SimulatePreExitCode (Long) Simulated Pre Step Exit Code

State (enumJobState) Job State

StdErrorLogFilename (String) Std. Error Log filename

SubmissionDateTime (Date) Date of Job Submission

SubState (enumJobSubState) Job Sub-State

SuccessCodeRule (String) One or more values that indicate a success exit code. Numbers, NTMSG, ODD, EVEN, LZERO can be used. A dash between 2 numbers indicates an inclusive range.

TemplateID (Long) Template Job ID.

TimerTrigger (enumJobTimerTriggerType) Indicates recurring or non-recurring job, deferred or immediate

TimeZone (enumJobTimeZoneType) Indicates the time zone to use when scheduling date/time triggers

UserDefinedText (String) User defined information

Username (String) Username

WaitDuration (Long) Job Dependency Wait Duration (see WaitDurationUnit)

WaitDurationUnit (enumJobDependentWaitDurationUnit) time unit for WaitDuration

WaitInterval (Long) Job Dependency Wait Interval (see WaitIntervalUnit)

WaitIntervalUnit (enumJobDependentWaitIntervalUnit) time unit for WaitInterval

Page 96: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

86

Property Name Description

WorkingDirectory (String) Device and Directory that job is initially set to execute within

Table 85 - AbatJob Properties

Page 97: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

87

3.10.1 Abort Method The Abort method is used to abort a Job. A Job can be aborted regardless of state with the single exception that a “Completed” job must be deleted.

Syntax objJob.Abort

Element Description

objJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 86 – Abort Method

3.10.2 CopyObject Method The CopyObject method is used to create a copy of the current job.

Syntax objNewJob = objJob.CopyObject

Element Description

ObjNewJob (AbatJob) If successful, this object will contain the duplicate of the objJob Object.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 87 – CopyObject Method

Page 98: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

88

3.10.3 Delete Method The Delete method is used to delete a Job. A Job can be deleted regardless of state. If a Job Template is deleted all instances of the job are aborted and then deleted as well.

Syntax objJob.Delete

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 88 – Delete Method

3.10.4 GetAlerts Method The GetAlerts method is used to retrieve a collection of AbatJobAlert Objects that contains the Job’s alerts.

Syntax objJobAlerts = objJob.GetAlerts

Element Description

ObjJobAlerts (AbatJobAlerts) If successful, this object will contain a collection of Job Alerts that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 89 – GetAlerts Method

Page 99: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

89

3.10.5 GetAssociatedSchedules Method The GetAssociatedSchedules method is used to retrieve a collection of AbatSchedule Objects that contains the Job’s associated schedules.

Syntax objSchedules = objJob.GetAssociatedSchedules

Element Description

ObjSchedules (AbatSchedules) If successful, this object will contain a collection of Schedules that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 90 – GetAssociatedSchedules Method

3.10.6 GetAudits Method The GetAudits method is used to retrieve a collection of AbatJobAudit Objects that contains the Job’s audit trail. Every ActiveBatch interaction with a Job generates an audit trail that can be retrieved with this method.

Syntax objJobAudits = objJob.GetAudits

Element Description

ObjJobAudits (AbatJobAudits) If successful, this object will contain a collection of Job Audits that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 91 – GetAudits Method

Page 100: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

90

3.10.7 GetDependencies Method The GetDependencies method is used to retrieve a collection of AbatJobDependency Objects that contains the Job dependencies.

Syntax objJobDependencies = objJob.GetDependencies

Element Description

objJobDependencies (AbatJobDependencies) If successful, this object will contain a collection of Job Dependencies that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 92 – GetDependencies Method

3.10.8 GetEventTriggers Method The GetEventTriggers method is used to retrieve a collection of AbatJobEventTrigger Objects that contains the Job’s Event Triggers.

Syntax objJobEventTriggers = objJob.GetEventTriggers

Element Description

objJobEventTriggers (AbatJobEventTriggers) If successful, this object will contain a collection of Job Event Triggers that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 93 – GetEventTriggers Method

Page 101: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

91

3.10.9 GetExclusionList Method The GetExclusionList method is used to retrieve a collection of AbatVariantItem Objects that contains the Job’s list of date and times that the Job should not run.

Syntax objVariantItems = objJob.GetExclusionList

Element Description

objVariantItems (AbatVariantItems) If successful, this object will contain a collection of VariantItem Objects that have Exclusion Dates & Times. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = DateTime

• = DateTime_EnableUseDateOnly

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 94 – GetExclusionList Method

3.10.10 GetExecutionMachineCharacteristics Method The GetExecutionMachineCharacteristics method is used to retrieve a collection of AbatCharacteristic Objects that contains the Job’s associated machine characteristics.

Syntax objCharacteristics = objJob.GetExecutionMachineCharacteristics

Element Description

objCharacteristics (AbatCharacteristics) If successful, this object will contain a collection of Execution Machine Characteristics that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 95 – GetExecutionMachineCharacteristics Method

Page 102: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

92

3.10.11 GetHistory Method The GetHistory method is used to retrieve the Job’s Historical information.

Syntax objJobHistory = objJob.GetHistory

Element Description

ObjJobHistory (AbatJobHistory) If successful, this object will contain all of the history information for the Job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 96 – GetHistory Method

3.10.12 GetJobFailureStarts Method The GetJobFailureStarts method is used to retrieve a collection of AbatVariantItem Objects that contains the JobIDs that are to be started if the Job fails.

Syntax objVariantItems = objJob.GetJobFailureStarts

Element Description

objVariantItems (AbatVariantItems) If successful, this object will contain a collection of VariantItem Objects that have Batch Failure Starts. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = Job_JobID

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 97 – GetJobFailureStarts Method

Page 103: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

93

3.10.13 GetJobSuccessStarts Method The GetJobSuccessStarts method is used to retrieve a collection of AbatVariantItem Objects that contains the JobIDs that are to be started if the Job succeeds.

Syntax objJobs = objJob.GetJobSuccessStarts

Element Description

objVariantItems (AbatVariantItems) If successful, this object will contain a collection of VariantItem Objects that have Batch Success Starts. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = Job_JobID

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 98 – GetJobSuccessStarts Method

3.10.14 GetNotifications Method The GetNotifications method is used to retrieve a collection of AbatJobNotification Objects that contains the Job’s notifications.

Syntax objJobNotifications = objJob.GetNotifications

Element Description

objJobNotifications (AbatNotifications) If successful, this object will contain a collection of Job Notifications that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 99 – GetNotifications Method

Page 104: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

94

3.10.15 GetSecurityAccounts Method The GetSecurityAccounts method is used to retrieve the accounts that are associated with the given Job.

Syntax objSecurityAccounts = objJob.GetSecurityAccounts

Element Description

objSecurityAccounts (AbatSecurityAccounts) If successful, this object will contain a collection of Security Accounts that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 100 – GetSecurityAccounts Method

3.10.16 GetUserCharacteristics Method The GetUserCharacteristics method is used to retrieve a collection of AbatCharacteristic Objects that contains the Job’s associated user characteristics.

Syntax objCharacteristics = objJob.GetUserCharacteristics

Element Description

objCharacteristics (AbatCharacteristics) If successful, this object will contain a collection of User Characteristics that are associated with this job.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 101 – GetUserCharacteristics Method

Page 105: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

95

3.10.17 Hold Method The Hold method is used to hold a Job. The Job cannot currently be executing.

Syntax objJob.Hold

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 102 – Hold Method

3.10.18 IsJobTemplate Method The IsJobTemplate method is used to determine whether the Job is an Instance or a Template. A TRUE indication means the selected Job object is a Template. A FALSE indication means the Job is an Instance.

Syntax TrueOrFalse = objJob.IsJobTemplate

Element Description

TrueOrFalse (Boolean) If successful, a TRUE indication means that the Job is a template; otherwise a FALSE indicates the Job is not a template.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 103 – IsJobTemplate Method

Page 106: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

96

3.10.19 MoveTo Method The MoveTo method is used to move a Job from one queue to a specified queue.

Syntax objJob.MoveTo (QueueName)

Element Description

QueueName (String) Specifies the name of an existing Queue to move this Job to.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 104 – MoveTo Method

3.10.20 Pause Method The Pause method is used to suspend a currently executing Job. Note: Not all Operating Systems support this feature. Windows NT V4 causes only the main thread to be suspended, which may not be the intention of the issuer.

Syntax objJob.Pause

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 105 – Pause Method

Page 107: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

97

3.10.21 ReleaseJob Method The ReleaseJob method is used to release a previously held Job.

Syntax objJob.ReleaseJob

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 106 – ReleaseJob Method

3.10.22 ResetMonitorCPUTimeAverages Method The ResetMonitorCPUTimeAverages method is used to reset a template job’s CPU Time Averages.

Syntax objJob.ResetMonitorCPUTimeAverages

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 107 – ResetMonitorCPUTimeAverages Method

Page 108: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

98

3.10.23 ResetMonitorRunTimeAverages Method The ResetMonitorRunTimeAverages method is used to reset a template job’s Run Time (elapsed) Averages.

Syntax objJob. ResetMonitorRunTimeAverages

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 108 – ResetMonitorRunTimeAverages Method

3.10.24 Restart Method The Restart method is used to restart a currently executing Job. The Job cannot currently be pending or have completed execution.

Syntax objJob.Restart

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 109 – Restart Method

Page 109: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

99

3.10.25 Resume Method The Resume method is used to resume a paused job.

Syntax objJob.Resume

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 110 – Resume Method

3.10.26 Synchronize Method The Synchronize method is used to synchronize execution with another currently executing Job Instance.

Syntax objJob.Synchronize

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 111 – Synchronize Method

Page 110: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

100

3.10.27 TakeOwnership Method The TakeOwnership method is used to change the Owner property of a Job. The user issuing the method takes ownership. The owner cannot be specified.

Syntax objJob.TakeOwnership

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 112 – TakeOwnership Method

3.10.28 Trigger Method The Trigger method is used to trigger a waiting job. The Job must have enabled ActiveBatch Trigger Events. If none of the parameters below are specified the Job Instance is created on the currently assigned queue unless that queue is the OnDemand queue (in which case the Trigger is ignored).

Syntax objJob.Trigger ([QueueName], [JobParameters], [IgnoreFlags])

Element Description

QueueName (String) Specifies the name of the Queue to which this job is to be triggered to run on.

JobParameters (String) Specifies parameters that can be passed to the Job for execution.

IgnoreFlags (Variant) This specifies one or more of the constants from the enumJobTriggerFlags Constants.

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 113 – Trigger Method

Page 111: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

101

3.10.29 Update Method The Update method is used to update any properties that were changed for this job.

Syntax objJob.Update

Element Description

ObjJob (AbatJob) This object represents the Job Object that the method is to operate on.

Table 114 – Update Method

Page 112: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

102

3.11 AbatJobs Object This object represents a collection of AbatJob objects. The tables below represent the specific methods and properties for this collection object. This collection object also supports Visual Basic’s FOR…EACH syntax.

Method Description

Add Add a Job

Remove Remove a Job

Table 115 - AbatJobs Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatJob) Job object also accessible via Item(index)

Table 116 - AbatJobs Properties

Page 113: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

103

3.11.1 Add Method The Add method is used to add a Job object to the ActiveBatch system.

Syntax objJobs.Add (JobToAdd)

Element Description

JobToAdd (AbatJob) This object represents the Job that will be added to the collection.

ObjJobs (AbatJobs) This object represents the Jobs collection that the method is to operate on.

Table 117 - Add Method

3.11.2 Remove Method The Remove method is used to remove a Job object.

Syntax objJobs.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index, which represents the Job object number within the collection object, OR you may specify the Job ID you are interested in removing.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove. If SearchType is abatST_Key, then this should be a Long referring to the Job ID of the Job that you want to delete.

ObjJobs (AbatJobs) This object represents the Jobs collection that the method is to operate on.

Table 118 - Remove Method

Page 114: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

104

3.12 AbatJobAlert Object This object represents a Job Alert. A Job Alert can cause a directed action to be performed.

This object exposes no special methods.

Property Name Description

Action (Variant) The target of the action

ActionType (enumJobAlertActionType) The action to be taken (i.e. Mail, Messenger, etc)

EventLogLocation (enumEventLogType) Location of the whose Event Log the Alert should be sent to

Type (enumJobAlertType) The cause of the alert

Table 119 - AbatJobAlert Properties

Page 115: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

105

3.13 AbatJobAlerts Object This object represents a collection of AbatJobAlerts objects.

Method Description

Add Add a Job Alert

Remove Remove a Job Alert

Table 120 - AbatJobAlerts Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatJobAlert) Job Alert object also accessible via Item (index)

Table 121 - AbatJobAlerts Properties

Page 116: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

106

3.13.1 Add Method The Add method is used to add a Job Alert object to the ActiveBatch system.

Syntax objJobAlerts.Add (JobAlertToAdd)

Element Description

JobAlertToAdd (AbatJobAlert) This object represents the Job Alert that will be added to the collection.

ObjJobAlerts (AbatJobAlerts) This object represents the Job Alerts collection that the method is to operate on.

Table 122 - Add Method

3.13.2 Remove Method The Remove method is used to remove a Job Alert object.

Syntax objJobAlerts.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index that represents the Job Alert object number within the collection.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove

ObjJobAlerts (AbatJobAlerts) This object represents the Job Alerts collection that the method is to operate on.

Table 123 - Remove Method

Page 117: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

107

3.14 AbatJobAudit Object This object represents a Job Audit. A Job Audit is caused by every ActiveBatch interaction with the Job.

This object exposes no special methods.

Property Name Description

Description (String) Audit message

Time (Date) The Date/Time the audit record occurred

Type (enumJobAuditType) Specifies the severity of the Audit.

Table 124 - AbatJobAudit Properties

Page 118: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

108

3.15 AbatJobAudits Object This object represents a collection of AbatJobAudits objects.

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatJobAudit) Job Audit object also accessible via Item (index)

Table 125 - AbatJobAudits Properties

Page 119: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

109

3.16 AbatJobDependency Object This object represents a Job Dependency. A Job Dependency object describes a single “prerequisite” that must either complete successfully or just complete before the Job is allowed to begin execution. A Job may have no dependencies or one or more dependencies.

This object exposes no special methods.

Property Name Description

DependentJobID (Long) Job ID of Job we are dependent on

Instance (enumJobDependentInstanceType) This property indicates what “instance” of the dependency should we examine

LastCompletedWithinDays (Long) If instance is “last completed” this indicates a “days” portion of how far back we should look

LastCompletedWithinHours (Long) If instance is “last completed” this indicates an “hours” portion of how far back we should look

LastCompletedWithinMinutes (Long) If instance is “last completed” this indicates a “minutes” portion of how far back we should look

LogicalOperation (enumJobDependentLogicalOperationType) Indicates whether preceding dependencies should be ANDed or ORed

Type (enumJobDependentType) This indicates whether the dependency is for success or just completion

Table 126 - AbatJobDependency Properties

Page 120: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

110

3.17 AbatJobDependencies Object This object represents a collection of AbatJobDependency objects.

Method Description

Add Add a Job Dependency

MoveItemTo Reorder a Job Dependency

Remove Remove a Job Dependency

Table 127 - AbatJobDependencies Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatJobDependency) Job Dependency object also accessible via Item(index)

Table 128 - AbatJobDependencies Properties

Page 121: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

111

3.17.1 Add Method The Add method is used to add a Job Dependency object to the ActiveBatch system.

Syntax objJobDependencies.Add (JobDependencyToAdd)

Element Description

JobDependencyToAdd (AbatJobDependency) This object represents the Job Dependency that will be added to the collection.

objJobDependencies (AbatJobDependencies) This object represents the Job Dependencies collection that the method is to operate on.

Table 129 - Add Method

3.17.2 Remove Method The Remove method is used to remove a Job Dependency object.

Syntax objJobDependencies.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index that represents the Job Dependency object number within the collection.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove

objJobDependencies (AbatJobDependencies) This object represents the Job Dependencies collection that the method is to operate on.

Table 130 - Remove Method

Page 122: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

112

3.17.3 MoveItemTo Method The MoveItemTo method is used to move a Job Dependency object from one position in the collection to another.

Syntax objJobDependencies. MoveItemTo (sourcePosition, destinationPosition)

Element Description

SourcePosition (Long) Specifies the Index in the collection of the source item to move.

destinationPosition (Long) Specifies the Index in the collection of the destination position.

objJobDependencies (AbatJobDependencies) This object represents the Job Dependencies collection that the method is to operate on.

Table 131 - MoveItemTo Method

Page 123: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

113

3.18 AbatJobEventTrigger Object This object represents a Job Event Trigger. A Job Event trigger object describes a single event. A Job can have one or more event triggers.

Method Description

GetPrivileges (AbatVariantItems) If successful, will contain a collection of the privilege strings associated with this object.

Table 132 - AbatEventTrigger Methods

Property Name Description

AuthenticationLevel (enumAuthenticationLevel) Specifies the level of authentication needed for the Event

Authority (String) Specifies the authority for the Event

EnableRememberPassword (Boolean) Specifies whether to remember the password

EnableRunJobOnEventMachine (Boolean) Specifies whether the Job that is associated with this event should be run on the Event Machine

EnableTriggerOnceOnly (Boolean) If TRUE, the Job is only triggered once

EventID (Long) Event ID. Unique.

EventText (String) Executable description of event

ImersonationLevel (enumImpersonationLevel) Specifies the level of impersonation required for the Event

NameSpace (String) Namespace that event is to operate within

Password (String) Specifies the user’s password

Type (enumJobEventTriggerType) Type of event

Username (String) Specifies the user’s name

Table 133 - AbatEventTrigger Properties

Page 124: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

114

3.18.1 GetPrivileges Method The GetPrivileges method is used to retrieve Privileges that need to be asserted for the Job Alert to function correctly.

Syntax objVariantItems = objJobEventTrigger.GetPrivileges

Element Description

objVariantItems (AbatVariantItems) If successful, this object will contain VariantItem Objects that have Privilege strings. Note: Only certain properties of the AbatVariantItem Object are populated for this collection:

• = Event_EnablePrivilege

• = Event_Privilege

objJobEventTrigger (AbatJobEventTrigger) This object represents the Job Event Trigger Object that the method is to operate on.

Table 134 – GetPrivileges Method

Page 125: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

115

3.19 AbatJobEventTriggers Object This object represents a collection of AbatJobAlert objects.

Method Description

Add Job Event Trigger to add

Remove Job Event Trigger to remove

Table 135 - AbatJobEventTriggers Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatJobEventTrigger) Job Alert object also accessible via Item (index)

Table 136 - AbatJobEventTriggers Properties

Page 126: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

116

3.19.1 Add Method The Add method is used to add a Job Event Trigger object to the ActiveBatch system.

Syntax objJobEventTriggers.Add (JobEventTriggerToAdd)

Element Description

JobEventTriggerToAdd (AbatJobEventTrigger) This object represents the Job Event Trigger that will be added to the collection.

objJobEventTriggers (AbatJobEventTriggers) This object represents the Job Event Triggers collection that the method is to operate on.

Table 137 - Add Method

3.19.2 Remove Method The Remove method is used to remove a Job Event Trigger object.

Syntax objJobEventTriggers.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index that represents the Event Trigger object number within the collection. You may also specify the key, which is the Event ID of the Event requested.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove. If SearchType is abatST_Key, then this should be a Long referring to the Event ID of the Event to remove.

objJobEventTriggers (AbatJobEventTriggers) This object represents the Event Triggers collection that the method is to operate on.

Table 138 - Remove Method

Page 127: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

117

3.20 AbatJobHistory Object This object represents a Job’s History. History on a Job begins as soon as it is submitted.

This object exposes no special methods.

Property Name Description

Aborted (Boolean) If TRUE, job was aborted

ActualCPUTime (String) The Actual CPU time the job used while executing. The format of the string is xx days xx hours xx minutes xx seconds xx milliseconds, where xx is a decimal number.

ActualRunTime (String) The Actual Run time of the job. The format of the string is xx days xx hours xx minutes xx seconds xx milliseconds, where xx is a decimal number.

Alerted (Boolean) Specifies if the Job was Alerted

AverageCPUTime (String) The Average CPU time of the job. The format of the string is xx days xx hours xx minutes xx seconds xx milliseconds, where xx is a decimal number.

AverageRunTime (String) The Average Run time of the job. The format of the string is xx days xx hours xx minutes xx seconds xx milliseconds, where xx is a decimal number.

CheckpointRestartEnabled (Boolean) Specifies if Checkpoint restart is enabled

CheckpointRestartValue (String) Specifies the last Checkpoint value

CompletionDateTime (Date) Date and time the job completed

CompletionMachine (String) The Execution Machine the job completed on

CompletionStatus (String) Specifies the Completion status of the Job

EventTriggerID (Long) If the job was Triggered by an Event, then this is the Event ID that triggered it

EventTriggerMachine (String) If the job was Triggered by an Event, then this is the Event Machine that the Event was triggered from

ExecutionDateTime (Date) Date and time the job began execution

ExecutionReason (enumHistoryJobExecutionReason) Specifies the reason that the job began execution

ExecutionUser (String) Specifies the User Account under which the Job Ran

Page 128: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

118

Property Name Description

FailedOver (Boolean) Specifies if the Job was Failed Over

InstancesExecuted (Long) Specifies the number of instances that have Executed (Template Jobs Only)

InstancesExecuting (Long) Specifies the number of instances that are Executing (Template Jobs Only)

InstancesFailed (Long) Specifies the number of instances that have Failed (Template Jobs Only)

InstancesSucceeded (Long) Specifies the number of instances that have Succeeded (Template Jobs Only)

JobReturnCode (Long) Job Exit Code

JobStepsCompleted (enumJobFlags) Specifies which Job Steps have completed

JobStepsToDo (enumJobFlags) Specifies which Job Steps have not been completed yet

LastAlertDateTime (Date) Specifies the Last time the Job sent an Alert

LastCheckpointDateTime (Date) Specifies the Last time a checkpoint was recorded

LastInstanceJobID (Long) Specifies the Last Instance Job Id (Template Jobs Only)

LastInstanceReturnCode (Long) Specifies the Last Instance Return Code (Template Jobs Only)

LastInstanceStatus (Long) Specifies the Last Instance Status (Template Jobs Only)

LogFilename (String) Specifies the Log File Name

PostJobReturnCode (Long) Post Job Step Exit Code

PreJobReturnCode (Long) Pre Job Step Exit Code

RestartCount (Long) Number of times job was restarted

RevisionDateTime (Date) Last date/time the job was revised

Restarted (Boolean) Was Job Restarted?

RevisionDateTime (Date) Specifies the Last Time the Job was modified

RevisionID (Long) Specifies the Revision ID

RevisionUser (String) Username that last revised job

Simulated (Boolean) Specifies whether the job was simulated

SubmissionQueue (String) Specifies the Queue under which the Job was submitted

TriggeredByUser (String) If the Job was Triggered by a user, it specifies the Username

Page 129: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

119

Table 139 - AbatJobHistory Properties

Page 130: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

120

3.21 AbatJobNotification Object This object represents a Job’s Notification. A Job Notification object represents an party who is interested in a Job start or completion event. Notifications should not be confused with Alerts.

This object exposes no special methods.

Property Name Description

Name (String) Name of the interested user

NotificationTime (enumNotificationTime) What event is to generate the notification?

Type (enumJobNotificationType) The type of notification

Table 140 - AbatJobNotification Properties

Page 131: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

121

3.22 AbatJobNotifications Object This object represents a collection of AbatJobNotifications objects.

Method Description

Add Job Notification to add

Remove Job Notification to remove

Table 141 - AbatJobNotifications Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatJobNotification) Job Notification object also accessible via Item (index)

Table 142 - AbatJobNotifications Properties

Page 132: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

122

3.22.1 Add Method The Add method is used to add a Job Notification object to the ActiveBatch system.

Syntax objJobNotifications.Add (JobNotificationToAdd)

Element Description

JobNotificationToAdd (AbatJobNotification) This object represents the Job Notification that will be added to the collection.

objJobNotifications (AbatJobNotifications) This object represents the Job Notifications collection that the method is to operate on.

Table 143 - Add Method

3.22.2 Remove Method The Remove method is used to remove a Job Notification object.

Syntax objJobNotifications.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index that represents the Notification object number within the collection. You may also specify the key, which is the Name of the Notification.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove. If SearchType is abatST_Key, then this should be a String referring to the Name of the Notification to remove.

objJobNotifications (AbatJobNotifications) This object represents the Notifications collection that the method is to operate on.

Table 144 - Remove Method

Page 133: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

123

3.23 AbatCharacteristic Object This object represents a Characteristic. A Characteristic object is further classified into User and Machine. The principal difference between the two is that User Characteristics are extensible and Machine Characteristics are not. The Job Scheduler uses any supplied characteristics to properly determine where a job is to run.

This object exposes no special methods.

Property Name Description

ComparisonType (enumCharacteristicComparisonType) This property determines how the “value” is to be compared to the current characteristic value

Name (String) Name of the characteristic

Type (enumCharacteristicType) Datatype of the characteristic

Unit (enumCharacteristicUnit) Specifies the unit associated with a characteristic

Value (Variant) Value of the Characteristic (depends on the Type property)

Table 145 - AbatCharacteristic Properties

Page 134: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

124

3.24 AbatCharacteristics Object This object represents a collection of AbatCharacteristics objects.

Method Description

Add Characteristic to add

Remove Characteristic to remove

Table 146 - AbatCharacteristics Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatCharacteristic) Characteristic object also accessible via Item (index)

Table 147 - AbatCharacteristics Properties

Page 135: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

125

3.24.1 Add Method The Add method is used to add a Characteristic object to the ActiveBatch system.

Syntax objChars.Add (CharToAdd)

Element Description

CharToAdd (AbatCharacteristic) This object represents the Characteristic that will be added to the collection.

ObjChars (AbatCharacteristics) This object represents the Characteristics collection that the method is to operate on.

Table 148 - Add Method

3.24.2 Remove Method The Remove method is used to remove a Characteristic object.

Syntax objChars.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index that represents the Characteristic object number within the collection. You may also specify the key, which is the Name of the Characteristic.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove. If SearchType is abatST_Key, then this should be a String referring to the Name of the Characteristic to remove.

ObjChars (AbatCharacteristics) This object represents the Characteristics collection that the method is to operate on.

Table 149 - Remove Method

Page 136: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

126

3.25 AbatSecurityAccount Object This object represents a Security Account. A Security Account object defines the user/account and their access level to the object. All of the major ActiveBatch objects allow for specific access level permissions.

This object exposes no special methods.

Property Name Description

Name (String) User/Group Account

Permission (Long) Access Permission

PermissionType (enumSecurityType) Type of permission (grant or deny)

Table 150 - AbatSecurityAccount Properties

Page 137: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

127

3.26 AbatSecurityAccounts Object This object represents a collection of AbatSecurityAccounts objects.

Method Description

Add Security Account to add

Remove Security Account to remove

Table 151 - AbatSecurityAccounts Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatSecurityAccount) Security Account object also accessible via Item(index)

Table 152 - AbatSecurityAccounts Properties

Page 138: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

128

3.26.1 Add Method The Add method is used to add a Security Account object to the ActiveBatch system.

Syntax objAccts.Add (CharToAdd)

Element Description

CharToAdd (AbatSecurityAccount) This object represents the Security Account that will be added to the collection.

ObjAccts (AbatSecurityAccounts) This object represents the Security Accounts collection that the method is to operate on.

Table 153 - Add Method

3.26.2 Remove Method The Remove method is used to remove a Security Account object.

Syntax objChars.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index that represents the Security Account object number within the collection. You may also specify the key, which is the Name of the Security Account.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove. If SearchType is abatST_Key, then this should be a String referring to the Name of the Security Account to remove.

ObjAccts (AbatSecurityAccounts) This object represents the Security Accountscollection that the method is to operate on.

Table 154 - Remove Method

Page 139: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

129

3.27 AbatVariantItem Object This object represents a VariantItem. A VariantItem object is typically used when the data type or property is dynamic. For example, searching for a Job by Name (String) or JobID (Long). The VariantItem can also be a collection object when searching for objects in which many instances of the object need to be passed back.

This object exposes no special methods.

Property Name Description

Calendar_FixedHolidayDate (Date) Specifies the Fixed Holiday Date

Calendar_FixedHolidayDayOfMonth (Long) Specifies the Fixed Holiday Day of the Month

Calendar_FixedHolidayMonthOfYear (enumScheduleMonths) Specifies the Fixed Holiday Month of the Year

Calendar_FixedHolidayName (String) Specifies the name of the Fixed Holiday

Calendar_FixedHolidayType (enumScheduleFixedHolidayType) Specifies the Fixed Holiday Type

Calendar_RelativeHolidayDayOfWeek (enumScheduleInstanceDay) Specifies the Relative Holiday Day of the Week

Calendar_RelativeHolidayInstance (enumScheduleInstanceType) Specifies the Relative Holiday Instance

Calendar_RelativeHolidayMonthOfYear (enumScheduleMonths) Specifies the Relative Holiday Month of the Year

Calendar_RelativeHolidayName (String) Specifies the Relative Holiday Name

DateTime (Date) Specifies a Date – Used for Exact Times in a Schedule and for the Exclusion List associated with a Job

DateTime_EnableUseDateOnly (Boolean) Specifies whether to use only the date portion of the DateTime property – This is only for the Exclusion List associated with a Job

Event_EnablePrivilege (Boolean) Specifies to Enable a Privilege

Event_Privilege (String) Specifies the Privilege

Job_EndTime (Date) Specifies the End Time for a completed Job

Job_JobID (Long) Specifies the Job ID

Job_StartTime (Date) Specifies the Start Time for a Job

Table 155 - AbatVariantItem Properties

Page 140: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

130

3.28 AbatVariantItems Object This object represents a collection of AbatVariantItems objects.

Method Description

Add Add a Variant Item

Remove Remove a Variant Item

Table 156 - AbatVariantItems Methods

Property Name Description

Count (Long) Number of objects in the collection

Item (AbatVariantItem) Variant Item object also accessible via Item(index)

Table 157 - AbatVariantItems Properties

Page 141: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

131

3.28.1 Add Method The Add method is used to add a VariantItem object to the ActiveBatch system.

Syntax objVariantItems.Add (VarItemToAdd)

Element Description

VarItemToAdd (AbaVariantItem) This object represents the VariantItem Object that will be added to the collection.

objVariantItems (AbaVariantItems) This object represents the VariantItems collection that the method is to operate on.

Table 158 - Add Method

3.28.2 Remove Method The Remove method is used to remove a VariantItem object.

Syntax objVariantItems.Remove (SearchType, Item)

Element Description

SearchType (enumSearchType) You may specify an Index that represents the Variant Item object number within the collection.

Item (Variant) If SearchType is abatST_Index, then this should be a Long referring to the Index of the item in the collection you want to remove.

objVariantItems (AbaVariantItems) This object represents the VariantItems collection that the method is to operate on.

Table 159 - Remove Method

Page 142: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

132

4 ActiveBatch Constants When you automate ActiveBatch by using an Automation object in an application that supports Visual Basic for Applications, you can use built-in constants to specify property and argument values.

However, when you automate ActiveBatch by using VBScript, you must use the numeric values that the constants represent. The following lists the built-in ActiveBatch constant enumerations.

enumAuthenticationLevel enumJobQSelectionType

enumCalendarSecurityAccess enumJobSecurityAccess

enumCalendarType enumJobState

enumCharacteristicComparisonType enumJobSubState

enumCharacteristicType enumJobTimerTriggerType

enumCharacteristicUnit enumJobTimeZoneType

enumEventLogType enumJobTriggerFlags

enumEventType enumJobType

enumImpersonationLevel enumPolicyType

enumJobAlertActionType enumQueueAlgorithmType

enumJobAlertType enumQueueQueryType

enumJobAuditType enumQueueSecurityAccess

enumJobDependentFailActionType enumQueueState

enumJobDependentInstanceType enumQueueType

enumJobDependentLogicalOperationType enumScheduleDays

enumJobDependentTriggerType enumScheduleDaySpecType

enumJobDependentType enumScheduleFixedHolidayType

enumJobDependentWaitDurationUnit enumScheduleInstanceDay

enumJobDependentWaitIntervalUnit enumScheduleInstanceType

enumJobEventTriggerFlags enumScheduleMonthlyType

enumJobEventTriggerType enumScheduleMonths

enumJobFlags enumScheduleSecurityAccess

enumJobHistoryExecutionReason enumScheduleTimeSpecType

enumJobLogType enumScheduleYearlyType

enumJobMonitorTimeType enumSearchType

enumJobNotificationTime enumSecurableObject

enumJobNotificationType enumSecurityAccessType

enumJobOnActiveActionType enumSystemSecurityAccess

Table 160 - ActiveBatch Constants

Page 143: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

133

4.1.1 enumAuthenticationLevel Constants

Constant Value

abatAL_None 1

abatAL_Connect 2

abatAL_Call 3

abatAL_Packet 4

abatAL_PacketIntegrity 5

abatAL_PacketPrivacy 6

Table 161 - enumAuthenticationLevel Constants

4.1.2 enumCalendarSecurityAccess Constants

Constant Value

abatCSA_Read 1

abatCSA_Write 2

abatCSA_Delete 4

abatCSA_Executive 8

abatCSA_FullControl 15

abatCSA_NoAccess 16

Table 162 - enumCalendarSecurityAccess Constants

4.1.3 enumCalendarType Constants

Constant Value

abatCalEntry_Relative 1

abatCalEntry_Every 2

abatCalEntry_Fixed 3

Table 163 - enumCalendarType Constants

Page 144: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

134

4.1.4 enumCharacteristicComparisonType Constants

Constant Value

abatCCT_Equal 1

abatCCT_Less 2

abatCCT_LessEqual 3

abatCCT_Greater 4

abatCCT_GreaterEqual 5

Table 164 – enumCharacteristicComparisonTypeConstants

4.1.5 enumCharacteristicType Constants

Constant Value

abatCT_String 1

abatCT_Numeric 2

Table 165 – enumCharacteristicType Constants

4.1.6 enumCharacteristicUnit Constants

Constant Value

abatCU_NotAvailable 1

abatCU_Mhz 2

abatCU_MB 3

Table 166 – enumCharacteristicUnit Constants

Page 145: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

135

4.1.7 enumEventType Constants

Constant Value

abatEVT_SchedulerUp 1

abatEVT_SchedulerDown 2

abatEVT_QueueAdded 30

abatEVT_QueueDeleted 31

abatEVT_QueueStateChange 32

abatEVT_QueueModified 33

abatEVT_JobAdded 50

abatEVT_JobRequeued 51

abatEVT_JobStateChange 52

abatEVT_JobModified 53

abatEVT_JobDeleted 54

Table 167 – enumEventType Constants

4.1.8 enumImpersonationLevel Constants

Constant Value

abatIL_Identify 1

abatIL_Impersonate 2

abatIL_Delegate 3

Table 168 – enumImpersonationLevel Constants

4.1.9 enumJobAlertActionType Constants

Constant Value

abatJAAT_SMTPAlert 1

abatJAAT_MessengerAlert 2

abatJAAT_JobTriggerAlert 3

abatJAAT_EventLog 4

Table 169 – enumJobAlertActionType Constants

Page 146: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

136

4.1.10 enumJobAlertType Constants

Constant Value

abatJALT_JobBeginsExecution 1

abatJALT_JobCompleted 2

abatJALT_JobCompletedFailure 3

abatJALT_JobAborted 4

abatJALT_JobReleased 5

abatJALT_JobOnTrigger 6

abatJALT_JobPendingExecution 7

abatJALT_JobRunTimeOverRun 8

abatJALT_JobCPUTimeOverRun 9

abatJALT_JobRunTimeUnderRun 10

abatJALT_JobCPUTimeUnderRun 11

abatJALT_JobRestarted 12

abatJALT_JobTriggerFailure 13

abatJALT_JobDependencyFailure 14

abatJALT_JobDelayed 15

Table 170 – enumJobAlertType Constants

4.1.11 enumJobAuditType Constants

Constant Value

abatJAT_Informational 1

abatJAT_Warning 2

abatJAT_Error 3

Table 171 – enumJobAuditType Constants

Page 147: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

137

4.1.12 enumJobDependentFailActionType Constants

Constant Value

abatJDFAT_Fail 32

abatJDFAT_Wait 64

Table 172 – enumJobDependentFailActionType Constants

4.1.13 enumJobDependentInstanceType Constants

Constant Value

abatJDIT_ExactActive 4

abatJDIT_LastCompleted 8

abatJDIT_AllInstances 16

Table 173 – enumJobDependentInstanceType Constants

4.1.14 enumJobDependentLogicalOperationType Constants

Constant Value

abatJDLOT_And 65536

abatJDLOT_Or 131072

Table 174 – enumJobDependentLogicalOperationType Constants

4.1.15 enumJobDependentTriggerType Constants

Constant Value

abatJDTRT_Ignore 262144

Table 175 – enumJobDependentTriggerType Constants

Page 148: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

138

4.1.16 enumJobDependentType Constants Constant Value

abatJDT_OnJobCompletion 1

abatJDT_OnJobSuccess 2

Table 176 – enumJobDependentType Constants

4.1.17 enumJobDependentWaitDurationUnit Constants

Constant Value

abatJDWDU_Days 1024

abatJDWDU_Hours 2048

abatJDWDU_Minutes 4096

abatJDWDU_Seconds 8192

abatJDWDU_Forever 16384

abatJDWDU_Time 32768

Table 177 – enumJobDependentWaitDurationUnit Constants

Page 149: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

139

4.1.18 enumJobDependentWaitIntervalUnit Constants

Constant Value

abatJDWIU_Hours 128

abatJDWIU_Minutes 256

abatJDWIU_Seconds 512

Table 178 – enumJobDependentWaitIntervalUnit Constants

4.1.19 enumJobEventTriggerFlags Constants

Constant Value

abatJETF_PasswordModified 1

abatJETF_UseAuthentication 2

abatJETF_TriggerOnce 4

abatJETF_EventTriggered 8

abatJETF_UseEventMachine 16

Table 179 – enumJobEventTriggerFlags Constants

4.1.20 enumJobEventTriggerType Constants

Constant Value

abatJETT_WMI 1

abatJETT_Startup 2

Table 180 – enumJobEventTriggerType Constants

Page 150: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

140

4.1.21 enumJobFlags Constants

Constant Value

abatJF_Pre 1

abatJF_Job 2

abatJF_Post 4

Table 181 – enumJobFlags Constants

4.1.22 enumJobHistoryExecutionReason Constants

Constant Value

abatJHER_None 1

abatJHER_DateTime 2

abatJHER_Triggered 3

abatJHER_EventTriggered 4

abatJHER_BatchStartOrAlert 5

Table 182 – enumJobHistoryExecutionReason Constants

4.1.23 enumJobLogType Constants

Constant Value

abatJLT_Central 1

abatJLT_LogFile 2

Table 183 – enumJobLogType Constants

4.1.24 enumJobMonitorTimeType Constants

Constant Value

abatJMTT_Percent 1

abatJMTT_DeltaTime 2

Table 184 – enumJobMonitorTimeType Constants

Page 151: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

141

4.1.25 enumJobNotificationTime Constants

Constant Value

abatJNTI_JobStart 1

abatJNTI_JobFinish 2

Table 185 – enumJobNotificationTime Constants

4.1.26 enumJobNotificationType Constants

Constant Value

abatJNT_Messenger 1

abatJNT_EMail 2

Table 186 – enumJobNotificationType Constants

4.1.27 enumJobOnActiveActionType Constants

Constant Value

abatJOAT_Skip 1

abatJOAT_Run 2

abatJOAT_Wait 3

Table 187 – enumJobOnActiveActionType Constants

4.1.28 enumJobQSelectionType Constants

Constant Value

abatJQST_AnyExecutionMgr 1

abatJQST_AllExecutionMgr 2

Table 188 – enumJobQSelectionType Constants

Page 152: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

142

4.1.29 enumJobSecurityAccess Constants

Constant Value

abatJSA_Read 1

abatJSA_Write 2

abatJSA_Delete 4

abatJSA_Submit 8

abatJSA_Manage 16

abatJSA_Executive 32

abatJSA_Trigger 64

abatJSA_TriggerQueue 128

abatJSA_TriggerParams 256

abatJSA_FullControl 511

abatJSA_NoAccess 512

Table 189 – enumJobSecurityAccess Constants

4.1.30 enumJobState Constants

Constant Value

abatJS_Executing 1

abatJS_Pending 2

abatJS_Held 3

abatJS_Completed 4

abatJS_NotQueued 5

Table 190 – enumJobState Constants

Page 153: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

143

4.1.31 enumJobSubState Constants

Constant Value

abatJSS_Executing 1

abatJSS_ExecutingPre 2

abatJSS_ExecutingPost 3

abatJSS_QueueBusy 4

abatJSS_WaitingDependency 5

abatJSS_WaitingTrigger 6

abatJSS_WaitingMultipleInstance 7

abatJSS_Deferred 8

abatJSS_Success 9

abatJSS_Failure 10

abatJSS_Aborted 11

abatJSS_Paused 12

abatJSS_Aborting 13

abatJSS_Deleting 14

abatJSS_WaitingRestart 15

abatJSS_WaitingOnActiveInstance 16

Table 191 – enumJobSubState Constants

4.1.32 enumJobTimerTriggerType Constants

Constant Value

abatJTTT_Immediate 1

abatJTTT_Deferred 2

abatJTTT_Interval 3

abatJTTT_Schedule 4

Table 192 – enumJobTimerTriggerType Constants

Page 154: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

144

4.1.33 enumJobTimeZoneType Constants

Constant Value

abatJTZT_JobScheduler 1

abatJTZT_Client 2

abatJTZT_UTC 3

Table 193 – enumJobTimeZoneType Constants

4.1.34 enumJobTriggerFlags Constants

Constant Value

abatJTF_IgnoreDependencies 1

abatJTF_IgnoreExclusionList 2

abatJTF_IgnoreCalendar 4

Table 194 – enumJobTriggerFlags Constants

4.1.35 enumJobType Constants

Constant Value

abatJT_Normal 1

abatJT_Template 2

abatJT_Instance 3

Table 195 – enumJobType Constants

Page 155: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

145

4.1.36 enumPolicyType Constants

Constant Value

abatPT_Boolean 1

abatPT_Time 2

abatPT_String 3

abatPT_Numeric 4

Table 196 – enumPolicyType Constants

4.1.37 enumQueueAlgorithmType Constants

Constant Value

abatQAT_Sequential 1

abatQAT_Round_Robin 2

abatQAT_Load_Balance 3

Table 197 – enumQueueAlgorithmType Constants

4.1.38 enumQueueQueryType Constants

Constant Value

abatQQT_Execution 1

abatQQT_Generic 2

abatQQT_OnDemand 4

abatQQT_All 7

Table 198 – enumQueueQueryType Constants

Page 156: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

146

4.1.39 enumQueueSecurityAccess Constants

Constant Value

abatQSA_Executive 1

abatQSA_Manage 2

abatQSA_User 4

abatQSA_FullControl 7

abatQSA_NoAccess 8

Table 199 – enumQueueSecurityAccess Constants

4.1.40 enumQueueState Constants

Constant Value

abatQS_Open 1

abatQS_Close 2

abatQS_Start 4

abatQS_Starting 8

abatQS_Stopping 16

abatQS_Stop 32

Table 200 – enumQueueState Constants

4.1.41 enumQueueType Constants

Constant Value

abatQT_Execution 1

abatQT_Generic 2

abatQT_OnDemand 3

Table 201 – enumQueueType Constants

Page 157: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

147

4.1.42 enumScheduleDays Constants

Constant Value

abatSD_Sunday 1

abatSD_Monday 2

abatSD_Tuesday 4

abatSD_Wednesday 8

abatSD_Thursday 16

abatSD_Friday 32

abatSD_Saturday 64

Table 202 – enumScheduleDays Constants

4.1.43 enumScheduleDaySpecType Constants

Constant Value

abatSDST_Daily 1

abatSDST_Weekly 2

abatSDST_Monthly 3

abatSDST_Yearly 4

Table 203 – enumScheduleDaySpecType Constants

4.1.44 enumScheduleFixedHolidayType Constants

Constant Value

abatSFHT_Every 1

abatSFHT_Fixed 2

Table 204 – enumScheduleFixedHolidayType Constants

Page 158: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

148

4.1.45 enumScheduleInstanceDay Constants

Constant Value

abatSID_Sunday 1

abatSID_Monday 2

abatSID_Tuesday 3

abatSID_Wednesday 4

abatSID_Thursday 5

abatSID_Friday 6

abatSID_Saturday 7

abatSID_Day 8

abatSID_WeekDay 9

abatSID_WeekendDay 10

Table 205 – enumScheduleInstanceDay Constants

4.1.46 enumScheduleInstanceType Constants

Constant Value

abatSIT_First 1

abatSIT_Second 2

abatSIT_Third 3

abatSIT_Fourth 4

abatSIT_Last 5

Table 206 – enumScheduleInstanceType Constants

4.1.47 enumScheduleMonthlyType Constants

Constant Value

abatSMT_Day 1

abatSMT_Nth 2

Table 207 – enumScheduleMonthlyType Constants

Page 159: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

149

4.1.48 enumScheduleMonths Constants

Constant Value

abatSM_January 1

abatSM_February 2

abatSM_March 3

abatSM_April 4

abatSM_May 5

abatSM_June 6

abatSM_July 7

abatSM_August 8

abatSM_September 9

abatSM_October 10

abatSM_November 11

abatSM_December 12

Table 208 – enumScheduleMonths Constants

4.1.49 enumScheduleSecurityAccess Constants

Constant Value

abatSHSA_Read 1

abatSHSA_Write 2

abatSHSA_Delete 4

abatSHSA_Executive 8

abatSHSA_FullControl 15

abatSHSA_NoAccess 16

Table 209 – enumScheduleSecurityAccess Constants

Page 160: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

150

4.1.50 enumScheduleTimeSpecType Constants

Constant Value

abatSTST_HoursMinutes 1

abatSTST_ExactTimes 2

abatSTST_Every 3

Table 210 – enumScheduleTimeSpecType Constants

4.1.51 enumScheduleYearlyType Constants

Constant Value

abatSYT_Every 1

abatSYT_Nth 2

Table 211 – enumScheduleYearlyType Constants

4.1.52 enumSearchType Constants

Constant Value

abatST_Key 1

abatST_Index 2

Table 212 – enumSearchType Constants

4.1.53 enumSecurableObject Constants

Constant Value

abatSecObj_Queue 200

abatSecObj_Job 201

abatSecObj_Schedule 202

abatSecObj_Calendar 203

Table 213 – enumSecurableObject Constants

Page 161: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

151

4.1.54 enumSecurityAccessType Constants

Constant Value

abatSAT_GrantAccess 1

abatSAT_DenyAccess 2

Table 214 – enumSecurityAccessType Constants

4.1.55 enumSystemSecurityAccess Constants

Constant Value

abatSSA_Executive 1

abatSSA_Manage 2

abatSSA_FullControl 3

abatSSA_NoAccess 4

Table 215 – enumSystemSecurityAccess Constants

Page 162: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

152

5 ActiveBatch WMI Provider Events The engine behind events in ActiveBatch is WBEM. WBEM is the industry-wide term for Web Based Enterprise Management and was created by the industry Distributed Management Task Force (DMTF) that created standards for allowing information interchange between hardware and software vendors. The WBEM initiative lets vendors write Information/Event Providers that communicate with WBEM software using a database “schema” approach. This schema is referred to as the CIM (Common Information Model). Customers write WBEM consumers that ask WBEM providers for object information. The beauty of this approach is that a single extensible database is available for a wide and disparate variety of sources. WBEM provides a point of integration through which data from management sources can be accessed, and it complements and extends existing management protocols and instrumentation such as SNMP, DMI and CMIP1. The Microsoft implementation of WBEM is known as Windows Management Instrumentation or WMI. WMI is freely available from ASCI for Windows NT V4 and 9x and is integrated into all Windows 2000 systems as part of the operating system installation.

ActiveBatch fully supports WMI as it is both a Provider and Consumer of WMI information. Moreover, ActiveBatch allows you to create and request your own events. WBEM users do this using a syntax based on SQL named WQL. WQL is a cross-platform WBEM language for requesting WBEM services. With WQL almost every hardware and software object can be queried for event usage. For example, suppose you wanted a batch job to begin execution when the free space on drive C: dropped below 30 percent. In the “old” days you would have written a batch job based on a time trigger which periodically ran and checked for the above condition. Now you can directly create an event in which ActiveBatch will only start the job when the condition occurs.

Reference information for the WQL syntax can be found either in Microsoft’s WMI Software Development Kit (SDK) or in the Microsoft Developor Network. More information about each can be found at Microsoft’s website (http://www.microsoft.com).

The WMI events produced by the ActiveBatch Job Scheduler are delivered in a data structure defined by the ASCI_AbatJssEvent class, as follows:

class ASCI_AbatJssEvent : __ExtrinsicEvent{

uint32 EventType; // Event Type Codestring EventMachine; // Event-generating Machinedatetime TimeStamp; // Event Time Stampstring QueueName; // Queue Name stringstring FromQueue; // Source Queue Name stringstring ToQueue; // Destination Queue Name stringstring AssocQueue; // Associated/Deassociated Queue Name stringstring JobName; // Job Name stringuint32 QueueType; // Queue Type Codeuint32 QueueState; // Current Queue Stateuint32 JobId; // Job Identifieruint32 TemplateId; // Template Job Iduint32 JobType; // Job Type Codeuint32 FromJobCount; // From Queue Job Countuint32 FromJobsHeld; // From Queue Jobs Held Countuint32 FromJobsExec; // From Queue Jobs Executing Countuint32 FromJobsPending; // From Queue Jobs Pending Countuint32 ToJobCount; // To Queue Job Count

1 This sentence was extracted from the Microsoft Windows Management Instrumentation Provider Programming White Paper, 1999.

Page 163: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

153

uint32 ToJobsHeld; // To Queue Jobs Held Countuint32 ToJobsExec; // To Queue Jobs Executing Countuint32 ToJobsPending; // To Queue Jobs Pending Countuint16 JobState; // Current Job Stateuint16 JobSubState; // Current Job SubState

};

The Event Type determines the information that is present for each event. The Event Type enumerated types are as follows:

Constant Value Description

abatEVT_SchedulerUp 1 Job Scheduler Started

abatEVT_SchdeulerDown 2 Job Scheduler Stopping

abatEVT_QueueAdded 30 New queue added to System

abatEVT_QueueDeleted 31 Queue deleted from System

abatEVT_QueueStateChange 32 Queue's state has changed

abatEVT_QueueModified 33 Queue properties have been modified

abatEVT_QueueAssociated 34 An Execution Queue has been associated with a Generic Queue

abatEVT_QueueDeassociated 35 An Execution Queue has been disassociated from a Generic Queue

abatEVT_JobAdded 50 New job added to System

abatEVT_JobRequeued 51 Job has been requeued

abatEVT_JobStateChange 52 Job's state/substate has changed

abatEVT_JobModified 53 Job's properties have been modified

abatEVT_JobFinished 54 Job has completed

abatEVT_JobDeleted 55 Job has been deleted from System

Table 216 – ActiveBatch WMI Provider Events Some properties of the ASCI_AbatJssEvent class are only valid based on the type of Event that the class represents. The EventType, EventMachine, and TimeStamp properties are always present in every Event that ActiveBatch provides. The following table presents the properties that are only valid for the specified event:

Event Type Valid WMI Event Object Properties

abatEVT_QueueAdded • = QueueName

• = QueueType

• = QueueState

Page 164: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

154

abatEVT_QueueDeleted • = QueueName

• = QueueType

abatEVT_QueueStateChange • = QueueName

• = QueueType

• = QueueState

abatEVT_QueueModified • = QueueName

• = QueueType

abatEVT_QueueAssociated • = QueueName

• = AssocQueue

• = QueueType

abatEVT_QueueDeassociated • = QueueName

• = AssocQueue

• = QueueType

abatEVT_JobAdded • = JobId • = FromJobsExec

• = TemplateId • = FromJobsPending

• = JobType • = QueueName

• = FromJobCount • = JobState

• = FromJobsHeld • = JobSubState

• = JobName

abatEVT_JobRequeued • = JobId • = ToJobsHeld

• = TemplateId • = ToJobsExec

• = JobType • = ToJobsPending

Page 165: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

155

• = JobType • = ToJobsPending

• = FromJobCount • = FromQueue

• = FromJobsHeld • = ToQueue

• = FromJobsExec • = JobState

• = FromJobsPending • = JobSubState

• = ToJobCount • = JobName

abatEVT_JobStateChange • = JobId • = JobSubState

• = TemplateId • = QueueName

• = JobType • = JobName

• = JobState

abatEVT_JobModified • = JobId • = QueueName

• = TemplateId • = JobName

• = JobType

abatEVT_JobFinished • = JobId • = FromJobsExec

• = TemplateId • = FromJobsPending

• = JobType • = QueueName

• = FromJobCount • = JobName

• = FromJobsHeld

abatEVT_JobDeleted • = JobId • = QueueName

• = TemplateId • = JobName

• = JobType

Table 217 – Valid WMI Event Class Properties

Page 166: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

156

6 ActiveBatch Messages

The following tables list all the pertinent ActiveBatch messages. The message codes follow the Windows 2000/NT convention and contain the severity as part of the message code. In addition, the messages themselves contain a facility code “ABAT”, a severity code (“I”, “W”,”E”) and the message name followed by the text of the message. All ActiveBatch messages are contained in the ABATMSG.DLL file, which can be found in the ActiveBatch installation directory.

Please note that the tables do not contain every ActiveBatch message but rather the messages, which a user can typically expect to see. The first table lists all the messages in alphabetical order; the second table lists the messages using the numeric value (in hexadecimal).

Message Value (hex) Description/Action ABAT-E-ABORTENTRY, Entry has been aborted

CFFD00C5 A job has been marked as ‘aborted’.

ABAT-E-ALLOCFAIL, Failure to allocate memory

CFFD0008 This is an internal error usually indicating that insufficient hardware or software resources are available to satisfy a memory request.

ABAT-E-ASSOCNOTFND, Failure to determine file association

CFFD015E The Execution Agent was unable to find the job file’s extension to program association. The job was not run.

ABAT-E-AUDPURGEFAIL, Failed to purge Audit ID %1!d!

CFFD01EB This DBPurge message can appear in the NT Application Event Log and indicates that DBPurge was unable to remove old audit messages from a specific job.

ABAT-E-BADPARAM, Bad parameter received

CFFD000B This is a general error indicating that a bad parameter was specified. Depending on the context you should specify a legal value or property and try again.

ABAT-E-BATCHSTARTERR, unable to launch Batch Start job

CFFD01CA A job completed and had a Batch Start (Success or Failure) action associated with it. That action could not be performed. Additional information accompanies this message indicating more specifically what the problem was.

ABAT-E-CONNECTFAIL, Failure to connect to Server, %1!s!

CFFD0005 This is a general non-specific error indicating that the client was unable to connect to a server machine. Please check the machine name or IP address and try again.

ABAT-E-CRELOGFILE, Failure to create log file

CFFD015F The Execution Agent was unable to create the batch job’s log file. Typically, the log file specification is not valid or proper. Please check the log file specification and ensure it can be created from the Execution machine.

ABAT-E-DBPURGEFAIL, An error occurred while running the DBPurge process. Please examine the NT Event

CFFD01EA Self-explanatory. This error message concerns the running of the DBPurge facility to prune unneeded jobs from the

Page 167: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

157

Message Value (hex) Description/Action Log/DBPurge Log for further details ActiveBatch system. ABAT-E-DEPENDFAIL, dependency failure CFFD01AE The Batch Job failed because a job

dependency could not be satisfied. ABAT-E-DISCONFAIL, Failure to disconnect from server

CFFD000E An error occurred disconnecting from a Job Scheduler machine. This is typically not something to be overly concerned about since the error occurs on the disconnect itself.

ABAT-E-DUPLICATE_KEY_VALUE, Duplicate key value

CFFD0070 This error is returned when an attempt has been made to create an object with a duplicate key (2 objects with the same name).

ABAT-E-DUPLICFND, A duplicate license was found. Please ensure that all licenses are valid and unique.

CFFD01D7 This serious error usually indicates some level of license tampering. Please run the ABATLIC program to obtain more information.

ABAT-E-EMGRCONNECTFAIL, Failure to connect to Execution Queue Manager

CFFD0007 The Job Scheduler was unable to connect to the Execution Agent machine. Please check the machine name or IP address and try again; the machine may not be on the network; the machine may not be running RPC or DCE services.

ABAT-E-EMGRFAIL, Network connection to the execution machine has been lost

CFFD0033 Self-explanatory. Depending on network conditions this problem may resolve itself as the machine is re-discovered.

ABAT-E-EXCCPUTIME, job aborted exceeding expected cpu time

CFFD01C5 The Execution Agent has set this job’s exit status code because of an overrun for CPU time and has aborted the job.

ABAT-E-EXCRUNTIME, job aborted exceeding expected run time

CFFD01C4 The Execution Agent has set this job’s exit status code because of an overrun for elapsed run time and has aborted the job.

ABAT-E-EXECABORT, job aborted due to Execution Agent failure

CFFD01D1 A job was aborted when an Execution Agent/machine failed. The job was not marked as being restartable.

ABAT-E-FAILURE, Failure in Batch Queue Management System operation

CFFD0002 A non-specific error occurred. The error is typically either internal or transient. Please try the operation again.

ABAT-E-FILESIZEERROR, The file being copied is larger than the system policy allows for

CFFD01A8 The ActiveBatch Administrator has prevented your file from being copied to the Execution Machine through the System policy CopyScriptMax

ABAT-E-GETOWNER, unable to obtain object owner

CFFD01E5 ActiveBatch is unable to retrieve the owner of the object. This error may appear if the domain of the owner’s account is not available.

ABAT-E-IMPERSONERR, Failure to impersonate client

CFFD00CF This error can be returned if you attempt to connect to a Job Scheduler while the Scheduler is still in the process of starting. Please wait a moment and try again.

Page 168: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

158

Message Value (hex) Description/Action ABAT-E-INITQFAIL, Failure to initialize a queue

CFFD000D The operation to initialize a queue failed. The queue was not created. A more specific error usually accompanies this error.

ABAT-E-INITSD, Failure to initialize ABAT Security Descriptor

CFFD0100 This is an internal error indicating a failure to create a security descriptor the object. This error may be logged to the product’s trace file.

ABAT-E-INSTSKIPPED, instance skipped due to active instance

CFFD01EC This audit message indicates that a job instance could not be executed because the template’s property did not allow multiple concurrent copies of the job to run simultaneously.

ABAT-E-INSTWAITFAIL, active instance wait failed

CFFD01ED This audit message indicates that a job instance could not be executed because the “If Job Active… Wait” property was enabled and the timeout period expired.

ABAT-E-INSUFFPRV, Insufficient privilege to perform Batch Queue Management operation

CFFD00FA You attempted to perform a queue or job operation for which you lack sufficient access permissions.

ABAT-E-INVCALCONFIG, An invalid Calendar configuration was made. Please make sure that all the calendar will allow a job to run at least once

CFFD01FF You have attempted to create a job and schedule combination in which the job will never run. For example, scheduling a job on December 25th and then assigning a Calendar with Christmas as a holiday.

ABAT-E-INVHISTPROP, Job save history duration must be greater or equal to the log file retension period

CFFD01C6 Self-explanatory.

ABAT-E-INVOPER, An invalid operation was specified

CFFD00DD Either: an invalid context was specified on an enumeration, or an invalid operation was specified based on a job current state. For example, attempting to release a job which isn’t held.

ABAT-E-INVOPNCLSTIME, Invalid queue OPEN time range or CLOSE time range

CFFD0024 The time you entered was not in 24-hour time format. 00:00 through 23:59 is the legal range.

ABAT-E-INVOSPRIORITY, Invalid operating system priority

CFFD0040 An illegal O/S priority value has been specified as part of a job.

ABAT-E-INVOSQPRIORITY, Invalid operating system scheduling priority

CFFD0020 You specified an illegal O/S priority value as the Job default with a queue.

ABAT-E-INVREGVAL, Invalid registry key value, %1!s!

CFFD0009 Data associated with a Registry Key is of an incompatible type. For example, the datatype should be REG_DWORD and the value was found to be REG_SZ; the value itself is not legal.

ABAT-E-INVSTRTSTPTIME, Invalid queue START time range or STOP time range

CFFD0023 The time you entered was not in 24-hour time format. 00:00 through 23:59 is the legal range.

ABAT-E-ITEMALREADYEXISTS, The item being added to the collection already exists

CFFD019D This general error indicates that you are attempting to add an object to a collection and the object already exists. For example, trying to add the same

Page 169: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

159

Message Value (hex) Description/Action account and access to a security collection.

ABAT-E-JOBABORT, Job aborted during execution

CFFD00C9 This is the exit status code of a job that has been aborted.

ABAT-E-JOBHISTORYERR, History information for the requested job could not be found

CFFD01A9 This is an internal error indicating that the Job’s History information could not be retrieved.

ABAT-E-JOBSCHEDFAIL, Job Scheduler failed to start

CFFD019A This is the exit status code of a Job Scheduler Service which could not be started. Check the trace file or NT Application Event Log for more information.

ABAT-E-JOBSONQUEUE, Jobs exist on queue

CFFD00C4 An attempt to delete a queue failed due to jobs currently on queue. You can indicate that a ‘flush’ operation first be performed prior to the actual queue delete.

ABAT-E-JSSCONNECTFAIL, Failure to connect to Job Scheduler

CFFD0006 The client was unable to connect to the Job Scheduler machine. Please check the machine name or IP address and try again; the machine may not be on the network.

ABAT-E-KEY_VALUE_NOT_FOUND, Key not found

CFFD006F This error/warning code indicates that a search for a specific object failed to be found in the database.

ABAT-E-LICENSEXP, license has expired CFFD0161 The evaluation serial number has expired. Please contact ASCI or your distributor for an extension.

ABAT-E-LOCALONLYLIC, This Personal Edition license is only permitted to communicate with a single Execution Agent on the Local Machine.

CFFD01DA When using the Personal Edition license you are restricted to a Workstation/Professional NT system and all connections are local to that system.

ABAT-E-LOGONERR, error logging user onto Execution Machine

CFFD00B5 This error indicates that the user’s username and/or password was not proper for logging the user onto the Execution Machine. Check the username and password (may be case sensitive) for the target system. More specific details may be found in the job’s log file.

ABAT-E-MAXEAGENTLIC, The maximum number of execution agent licenses has been met

CFFD01D3 This licensing error indicates that the maximum number of Execution Agent licenses has been reached. Count each Execution Machine you are attempting to connect to (regardless of whether the machine is active or the queue is started) and then compare against the value reported by the ABATLIC program.

ABAT-E-MSONLYLIC, This Job Scheduler license only permits connections to Microsoft Execution Agents

CFFD01D4 You are attempting to connect to a non-Microsoft Execution Agent and your license only permits you to connect to Microsoft Execution Agents.

Page 170: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

160

Message Value (hex) Description/Action ABAT-E-NOBINDINGFND, Binding handle not available or invalid registry %n protocol specified

CFFD000A This is an error indicating that a protocol sequence established in the Registry is not available on this machine. The RPC protocol sequence Registry key should be examined since it contains erroneous transports.

ABAT-E-NOMACHINENAME, No machine name has been specified

CFFD0003 A machine name needs to be specified. This error most typically occurs as a requirement for an execution queue or when connecting to a Job Scheduler machine.

ABAT-E-NOMORE, No more items 8FFD0178 This message code, typically returned as part of a context search, indicates that no more objects are available.

ABAT-E-NOPASSWORD, No password specified

CFFD0013 Attempting an advanced connection requires a password; attempting to execute a batch job requires a password (unless Blank Password is enabled). Specify the password and try again. Note: You can let Activebatch remember the password for you.

ABAT-E-NOQUEUENAME, No queue name specified

CFFD0010 No queue name was specified and one was required. Specify a valid queue name and try again.

ABAT-E-NOSUCHQUEUE, specified queue does not exist

CFFD00B0 Self-explanatory.

ABAT-E-NOTCONNECTED, A connection has not been successfully made to a Job Scheduler

CFFD019C You have attempted to perform an operation that requires a current connection to a Job Scheduler machine. Please make the connection and try again.

ABAT-E-NOTGENERIC, This is not a generic queue, unable to associate execution queues

CFFD00F9 Self-explanatory. Check queue properties.

ABAT-E-OPENCMDFILE, Failure to open command procedure

CFFD0160 The Execution Agent was unable to open the batch job’s script file. Please check the main job’s file specification and ensure it can be opened from the Execution machine.

ABAT-E-PROPERTYREADONLY, You cannot modify this job because it is set as Read Only

CFFD01B5 Self-explanatory.

ABAT-E-QUEUEALRDYEXISTS, The queue already exists

CFFD0038 An attempt to create a queue of the same name failed since queue names must be unique.

ABAT-E-QUEUENOTFND, Queue not found

CFFD002C The queue name you specified does not exist. Please check the spelling and try again.

ABAT-E-REGOPENERR, Failure to open registry HKEY_LOCAL_MACHINE subkey %1!s!

CFFD001C ActiveBatch was unable to open a Registry Key value in HKEY_LOCAL_MACHINE. While you should check Registry security permissions this error typically means that the ActiveBatch Registry keys have

Page 171: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

161

Message Value (hex) Description/Action been corrupted or otherwise tampered with. You should try executing a product REPAIR through the ADD/REMOVE Control Panel applet.

ABAT-E-REGVALERR, Failure to obtain registry value %1!s!

CFFD001D ActiveBatch was unable to obtain the specified Registry value-name. Typically this means the ActiveBatch Registry keys and/or value names have been corrupted or otherwise tampered with. You should try executing a product REPAIR through the ADD/REMOVE Control Panel applet.

ABAT-E-REQPROPERTYINV, The required property %1!s! is either absent or invalid

CFFD01A5 Self-explanatory.

ABAT-E-RUNJOBINTERACTIVE, Unable to run the job interactively

CFFD01FC An error occurred while attempting to run this job interactively. The error is most likely due to a lack of desktop permissions.

ABAT-E-SERVERCOMMUNICATIONERROR, There was an error that occurred while communicating with the server

CFFD01A2 The client interface encountered an error while communicating with the Job Scheduler.

ABAT-E-TAKEOWNERFAIL, attempt to take ownership of specified object failed

CFFD01E4 Your attempt to take ownership of this object failed. Verify that you have “Executive” level permission.

ABAT-E-UNEXPEXCEPTCOM, An unexpected exception has occurred in the COM client

CFFD01DF Self-explanatory.

ABAT-E-WRKSTNONLYLIC, The Personal Edition license is only permitted to run on a Workstation Platform

CFFD01F9 Self-explanatory.

ABAT-I-ADDBATCHPRIV, The account under which this job is executing has been adjusted to have the "Logon as Batch" right

4FFD01DD The batch user has been automatically granted the “Logon as a Batch User” right.

ABAT-I-DEPENDSAT, dependency is satisfied

4FFD01AD This audit message indicates that all job dependencies were met.

ABAT-I-EVTTRIGGERED, job triggered by event

4FFD0181 An event occurred which triggered execution of a job.

ABAT-I-JOBSTART, job %1!s!(%2!s!) started successfully on queue %3!s!

4FFD00B1 Self-explanatory. This message is displayed by the command-line client.

ABAT-I-JSSUP, The ActiveBatch Job Scheduler Service has started

4FFD0036 Self-explanatory. Typically found in the JSS Trace file or NT Application Event Log indicating the Job Scheduler Service has been started.

ABAT-I-MARKDELETE, job marked for deletion

4FFD01B4 Typically a template job is marked for deletion when one or more active instances are still executing.

ABAT-I-NOWBEM, WBEM services will not be available on this system

4FFD0191 Microsoft’s WMI Services are either not available or have not been started.

ABAT-S-SUCCESS, normal successful completion

0FFD0001 Operation completed normally. No action to be taken.

ABAT-W-ACCTLOOKUP, unable to lookup 8FFD019E ActiveBatch was unable to lookup the

Page 172: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

162

Message Value (hex) Description/Action account specified accounts SID and validate the

account. Check any domain and account name spelling.

ABAT-W-ASSIGNJOBFAIL, unable to assign process to job object

8FFD01B1 The Execution Agent could not create a Windows 2000 Job Object within which to encapsulate the batch job.

ABAT-W-CPYFILERR, error copying file to execution machine

8FFD0184 The Job Scheduler was unable to open the job step(s) script/program file. An additional error code provides more information.

ABAT-W-CREPRCERR, error creating batch process for job %1!s!

8FFD00B6 An error occurred creating the batch job process. More specific details may be found in the job’s log file.

ABAT-W-EXCRESTART, maximum restart value exceeded

8FFD01D2 The job could not be restarted as it has reached its maximum restart count.

ABAT-W-GETSDERR, unable to obtain Security Descriptor

8FFD01B8 ActiveBatch was unable to find the object’s Security Descriptor.

ABAT-W-JOBCANTEXEC, job cannot execute based on Exclusion List/Calendar

8FFD01E9 This audit message appears if a job was scheduled for execution but could not be executed due to an Exclusion List or Calendar conflict.

ABAT-W-JOBNOTEXEC, job not currently executing

8FFD0168 You cannot restart a job that is not currently executing.

ABAT-W-JSSCONNFAIL, failed to connect to Job Scheduler on %1!s!

8FFD00B8 Self-explanatory. Check that the machine’s name or IP address is correct; verify that the machine is up and connected to the proper network; verify the RPCSS or DCE services have been started.

ABAT-W-LOADJOBSFAIL, unable to load job objects dll

8FFD01B3 For Windows 2000 machines, the Execution Agent attempts to load a special DLL which associates Windows Job Objects with ActiveBatch jobs. This warning indicates that Windows 2000 Job Objects will not be used.

ABAT-W-NOCOPY, unable to copy files to execution machine

8FFD0183 Self-explanatory. Please check the job step(s) file specifications. They must be accessible from the client machine.

ABAT-W-NOQUEUESFOUND, no active execution queues found

8FFD0182 This error can occur when a Generic Queue with Round Robin scheduling determines that no active execution queues are available to dispatch a job.

ABAT-W-NOSUCHALERT, no such alert 8FFD017D The specified alert could not be found for update or deletion purposes.

ABAT-W-NOSUCHCALENDAR, specified calendar does not exist

8FFD01E0 Self-explanatory.

ABAT-W-NOSUCHCHAR, no such characteristic

8FFD0177 The machine or user characteristic you specified could not be found.

ABAT-W-NOSUCHCONTACT, contact information not found

8FFD017A The specified user/machine contact information could not be found for update or deletion purposes.

ABAT-W-NOSUCHJOB, specified job does not exist

8FFD00BB Self-explanatory. The job’s ID did not match any present jobs in the system.

Page 173: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

163

Message Value (hex) Description/Action ABAT-W-NOSUCHPOLICY, specified policy does not exist

8FFD0198 The specified policy does not exist. Check the policy name spelling.

ABAT-W-NOTNT, operation requires Windows NT

8FFD00AF The Job Scheduler and Execution Agent services cannot be run on non-Windows 2000/NT systems.

ABAT-W-NOTTEMPLATE, not a template job

8FFD0199 The specified job is not a template. Certain operations can only be performed on a template job, for example, you cannot submit or move a non-template job to the OnDemand queue.

ABAT-W-PROCAFFINITY, unable to set processor affinity

8FFD01BF A processor mask was specified for this job. However, the mask affinity operation could not be performed. The job will still execute. This can be caused if the number of actual processors is less than that specified or an O/S specific restriction on assigning processors to jobs is violated.

ABAT-W-PROPTYLOCKED, property is locked

8FFD018D An attempt to modify a property failed because the property was locked and cannot be changed by an ActiveBatch non-Administrator.

ABAT-W-REQPARMABS, required parameter absent

8FFD017E You didn’t specify a schedule ID or the query event string for a Job.

ABAT-W-RPCEXCEPT, RPC Exception thrown

8FFD01B6 This message, if displayed, would be found in a product trace file.

ABAT-W-SCHEDATTACHED, jobs attached to this schedule

8FFD0167 You cannot delete this schedule since jobs are currently associated. You can disassociate the jobs from this schedule and then delete the schedule.

ABAT-W-TERMJOBFAIL, unable to terminate job object

8FFD01B2 The Execution Agent could not terminate the Windows 2000 Job Object. More information typically follows this error.

ABAT-W-TRIGGERFAIL, failed to trigger/clone job

8FFD0192 A job was triggered was unable to be cloned. An additional message provides more information concerning this condition.

ABAT-W-TRIGGERSDISABLED, ActiveBatch Event Triggers are disabled

8FFD01C3 Unable to issue TRIGGER command as ActiveBatch Triggers are not enabled.

ABAT-W-UNEXPEXCEPT, unexpected exception occurred

8FFD0068 An unexpected exception occurred. Typically this message code is not delivered to user code and is found in the product’s trace file depending on the trace level specified.

ABAT-W-UNKJSS, unknown Job Scheduler 8FFD01A6 The Execution Agent was unable to reconnect back to the Job Scheduler machine.

ABAT-W-WBEMCONN, unable to connect to WBEM

8FFD01C1 The WMI software has either not been installed or started.

ABAT-W-WMIQUERYFAIL, WMI Query 8FFD01C2 ActiveBatch encountered an error

Page 174: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

164

Message Value (hex) Description/Action request failed issuing the Event Query string to WMI Database Error: Communications Error CFFD00EC This error usually indicates that

insufficient resources have been allocated for the Database server.

Database Error: Record manager inactive CFFD0079 This is an initialization error and indicates that the Database server has not been started. Verify that W32MKDE.EXE exists within the ActiveBatch installation directory.

Table 218 - ActiveBatch Messages (Alphabetical) The hexadecimal values below are subject to change and are documented for reference information only.

Value (hex) Message Description/Action 0FFD0001 ABAT-S-SUCCESS, normal successful

completion Operation completed normally. No action to be taken.

4FFD0036 ABAT-I-JSSUP, The ActiveBatch Job Scheduler Service has started

Self-explanatory. Typically found in the JSS Trace file or NT Application Event Log indicating the Job Scheduler Service has been started.

4FFD00B1 ABAT-I-JOBSTART, job %1!s!(%2!s!) started successfully on queue %3!s!

Self-explanatory. This message is displayed by the command-line client.

4FFD0181 ABAT-I-EVTTRIGGERED, job triggered by event

An event occurred which triggered execution of a job.

4FFD0191 ABAT-I-NOWBEM, WBEM services will not be available on this system

Microsoft’s WMI Services are either not available or have not been started.

4FFD01AD ABAT-I-DEPENDSAT, dependency is satisfied

This audit message indicates that all job dependencies were met.

4FFD01B4 ABAT-I-MARKDELETE, job marked for deletion

Typically a template job is marked for deletion when one or more active instances are still executing.

4FFD01DD ABAT-I-ADDBATCHPRIV, The account under which this job is executing has been adjusted to have the "Logon as Batch" right

The batch user has been automatically granted the “Logon as a Batch User” right.

8FFD0068 ABAT-W-UNEXPEXCEPT, unexpected exception occurred

An unexpected exception occurred. Typically this message code is not delivered to user code and is found in the product’s trace file depending on the trace level specified.

8FFD00AF ABAT-W-NOTNT, operation requires Windows NT

The Job Scheduler and Execution Agent services cannot be run on non-Windows 2000/NT systems.

8FFD00B6 ABAT-W-CREPRCERR, error creating batch process for job %1!s!

An error occurred creating the batch job process. More specific details may be found in the job’s log file.

8FFD00B8 ABAT-W-JSSCONNFAIL, failed to connect to Job Scheduler on %1!s!

Self-explanatory. Check that the machine’s name or IP address is correct; verify that the machine is up and connected to the proper network; verify the RPCSS or DCE services have been started.

8FFD00BB ABAT-W-NOSUCHJOB, specified job does Self-explanatory. The job’s ID did not

Page 175: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

165

Value (hex) Message Description/Action not exist match any present jobs in the system.

8FFD0167 ABAT-W-SCHEDATTACHED, jobs attached to this schedule

You cannot delete this schedule since jobs are currently associated. You can disassociate the jobs from this schedule and then delete the schedule.

8FFD0168 ABAT-W-JOBNOTEXEC, job not currently executing

You cannot restart a job that is not currently executing.

8FFD0177 ABAT-W-NOSUCHCHAR, no such characteristic

The machine or user characteristic you specified could not be found.

8FFD0178 ABAT-E-NOMORE, No more items This message code, typically returned as part of a context search, indicates that no more objects are available.

8FFD017A ABAT-W-NOSUCHCONTACT, contact information not found

The specified user/machine contact information could not be found for update or deletion purposes.

8FFD017D ABAT-W-NOSUCHALERT, no such alert The specified alert could not be found for update or deletion purposes.

8FFD017E ABAT-W-REQPARMABS, required parameter absent

You didn’t specify a schedule ID or the query event string for a Job.

8FFD0182 ABAT-W-NOQUEUESFOUND, no active execution queues found

This error can occur when a Generic Queue with Round Robin scheduling determines that no active execution queues are available to dispatch a job.

8FFD0183 ABAT-W-NOCOPY, unable to copy files to execution machine

Self-explanatory. Please check the job step(s) file specifications. They must be accessible from the client machine.

8FFD0184 ABAT-W-CPYFILERR, error copying file to execution machine

The Job Scheduler was unable to open the job step(s) script/program file. An additional error code provides more information.

8FFD018D ABAT-W-PROPTYLOCKED, property is locked

An attempt to modify a property failed because the property was locked and cannot be changed by an ActiveBatch non-Administrator.

8FFD0192 ABAT-W-TRIGGERFAIL, failed to trigger/clone job

A job was triggered was unable to be cloned. An additional message provides more information concerning this condition.

8FFD0198 ABAT-W-NOSUCHPOLICY, specified policy does not exist

The specified policy does not exist. Check the policy name spelling.

8FFD0199 ABAT-W-NOTTEMPLATE, not a template job

The specified job is not a template. Certain operations can only be performed on a template job, for example, you cannot submit or move a non-template job to the OnDemand queue.

8FFD019E ABAT-W-ACCTLOOKUP, unable to lookup account

ActiveBatch was unable to lookup the specified accounts SID and validate the account. Check any domain and account name spelling.

8FFD01A6 ABAT-W-UNKJSS, unknown Job Scheduler The Execution Agent was unable to reconnect back to the Job Scheduler machine.

Page 176: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

166

Value (hex) Message Description/Action 8FFD01B1 ABAT-W-ASSIGNJOBFAIL, unable to

assign process to job object The Execution Agent could not create a Windows 2000 Job Object within which to encapsulate the batch job.

8FFD01B2 ABAT-W-TERMJOBFAIL, unable to terminate job object

The Execution Agent could not terminate the Windows 2000 Job Object. More information typically follows this error.

8FFD01B3 ABAT-W-LOADJOBSFAIL, unable to load job objects dll

For Windows 2000 machines, the Execution Agent attempts to load a special DLL which associates Windows Job Objects with ActiveBatch jobs. This warning indicates that Windows 2000 Job Objects will not be used.

8FFD01B6 ABAT-W-RPCEXCEPT, RPC Exception thrown

This message, if displayed, would be found in a product trace file.

8FFD01B8 ABAT-W-GETSDERR, unable to obtain Security Descriptor

ActiveBatch was unable to find the object’s Security Descriptor.

8FFD01BF ABAT-W-PROCAFFINITY, unable to set processor affinity

A processor mask was specified for this job. However, the mask affinity operation could not be performed. The job will still execute. This can be caused if the number of actual processors is less than that specified or an O/S specific restriction on assigning processors to jobs is violated.

8FFD01C1 ABAT-W-WBEMCONN, unable to connect to WBEM

The WMI software has either not been installed or started.

8FFD01C2 ABAT-W-WMIQUERYFAIL, WMI Query request failed

ActiveBatch encountered an error issuing the Event Query string to WMI

8FFD01C3 ABAT-W-TRIGGERSDISABLED, ActiveBatch Event Triggers are disabled

Unable to issue TRIGGER command as ActiveBatch Triggers are not enabled.

8FFD01D2 ABAT-W-EXCRESTART, maximum restart value exceeded

The job could not be restarted as it has reached its maximum restart count.

8FFD01E0 ABAT-W-NOSUCHCALENDAR, specified calendar does not exist

Self-explanatory.

8FFD01E9 ABAT-W-JOBCANTEXEC, job cannot execute based on Exclusion List/Calendar

This audit message appears if a job was scheduled for execution but could not be executed due to an Exclusion List or Calendar conflict.

CFFD0002 ABAT-E-FAILURE, Failure in Batch Queue Management System operation

A non-specific error occurred. The error is typically either internal or transient. Please try the operation again.

CFFD0003 ABAT-E-NOMACHINENAME, No machine name has been specified

A machine name needs to be specified. This error most typically occurs as a requirement for an execution queue or when connecting to a Job Scheduler machine.

CFFD0005 ABAT-E-CONNECTFAIL, Failure to connect to Server, %1!s!

This is a general non-specific error indicating that the client was unable to connect to a server machine. Please check the machine name or IP address and try again.

CFFD0006 ABAT-E-JSSCONNECTFAIL, Failure to The client was unable to connect to the

Page 177: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

167

Value (hex) Message Description/Action connect to Job Scheduler Job Scheduler machine. Please check

the machine name or IP address and try again; the machine may not be on the network.

CFFD0007 ABAT-E-EMGRCONNECTFAIL, Failure to connect to Execution Queue Manager

The Job Scheduler was unable to connect to the Execution Agent machine. Please check the machine name or IP address and try again; the machine may not be on the network; the machine may not be running RPC or DCE services.

CFFD0008 ABAT-E-ALLOCFAIL, Failure to allocate memory

This is an internal error usually indicating that insufficient hardware or software resources are available to satisfy a memory request.

CFFD0009 ABAT-E-INVREGVAL, Invalid registry key value, %1!s!

Data associated with a Registry Key is of an incompatible type. For example, the datatype should be REG_DWORD and the value was found to be REG_SZ; the value itself is not legal.

CFFD000A ABAT-E-NOBINDINGFND, Binding handle not available or invalid registry %n protocol specified

This is an error indicating that a protocol sequence established in the Registry is not available on this machine. The RPC protocol sequence Registry key should be examined since it contains erroneous transports.

CFFD000B ABAT-E-BADPARAM, Bad parameter received

This is a general error indicating that a bad parameter was specified. Depending on the context you should specify a legal value or property and try again.

CFFD000D ABAT-E-INITQFAIL, Failure to initialize a queue

The operation to initialize a queue failed. The queue was not created. A more specific error usually accompanies this error.

CFFD000E ABAT-E-DISCONFAIL, Failure to disconnect from server

An error occurred disconnecting from a Job Scheduler machine. This is typically not something to be overly concerned about since the error occurs on the disconnect itself.

CFFD0010 ABAT-E-NOQUEUENAME, No queue name specified

No queue name was specified and one was required. Specify a valid queue name and try again.

CFFD0013 ABAT-E-NOPASSWORD, No password specified

Attempting an advanced connection requires a password; attempting to execute a batch job requires a password (unless Blank Password is enabled). Specify the password and try again. Note: You can let Activebatch remember the password for you.

CFFD001C ABAT-E-REGOPENERR, Failure to open registry HKEY_LOCAL_MACHINE subkey %1!s!

ActiveBatch was unable to open a Registry Key value in HKEY_LOCAL_MACHINE. While you should check Registry security

Page 178: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

168

Value (hex) Message Description/Action permissions this error typically means that the ActiveBatch Registry keys have been corrupted or otherwise tampered with. You should try executing a product REPAIR through the ADD/REMOVE Control Panel applet.

CFFD001D ABAT-E-REGVALERR, Failure to obtain registry value %1!s!

ActiveBatch was unable to obtain the specified Registry value-name. Typically this means the ActiveBatch Registry keys and/or value names have been corrupted or otherwise tampered with. You should try executing a product REPAIR through the ADD/REMOVE Control Panel applet.

CFFD0020 ABAT-E-INVOSQPRIORITY, Invalid operating system scheduling priority

You specified an illegal O/S priority value as the Job default with a queue.

CFFD0023 ABAT-E-INVSTRTSTPTIME, Invalid queue START time range or STOP time range

The time you entered was not in 24-hour time format. 00:00 through 23:59 is the legal range.

CFFD0024 ABAT-E-INVOPNCLSTIME, Invalid queue OPEN time range or CLOSE time range

The time you entered was not in 24-hour time format. 00:00 through 23:59 is the legal range.

CFFD002C ABAT-E-QUEUENOTFND, Queue not found

The queue name you specified does not exist. Please check the spelling and try again.

CFFD0033 ABAT-E-EMGRFAIL, Network connection to the execution machine has been lost

Self-explanatory. Depending on network conditions this problem may resolve itself as the machine is re-discovered.

CFFD0038 ABAT-E-QUEUEALRDYEXISTS, The queue already exists

An attempt to create a queue of the same name failed since queue names must be unique.

CFFD0040 ABAT-E-INVOSPRIORITY, Invalid operating system priority

An illegal O/S priority value has been specified as part of a job.

CFFD006F ABAT-E-KEY_VALUE_NOT_FOUND, Key not found

This error/warning code indicates that a search for a specific object failed to be found in the database.

CFFD0070 ABAT-E-DUPLICATE_KEY_VALUE, Duplicate key value

This error is returned when an attempt has been made to create an object with a duplicate key (2 objects with the same name).

CFFD0079 Database Error: Record manager inactive This is an initialization error and indicates that the Database server has not been started. Verify that W32MKDE.EXE exists within the ActiveBatch installation directory.

CFFD00B0 ABAT-E-NOSUCHQUEUE, specified queue does not exist

Self-explanatory.

CFFD00B5 ABAT-E-LOGONERR, error logging user onto Execution Machine

This error indicates that the user’s username and/or password was not proper for logging the user onto the Execution Machine. Check the username and password (may be case sensitive) for the target system. More

Page 179: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

169

Value (hex) Message Description/Action specific details may be found in the job’s log file.

CFFD00C4 ABAT-E-JOBSONQUEUE, Jobs exist on queue

An attempt to delete a queue failed due to jobs currently on queue. You can indicate that a ‘flush’ operation first be performed prior to the actual queue delete.

CFFD00C5 ABAT-E-ABORTENTRY, Entry has been aborted

A job has been marked as ‘aborted’.

CFFD00C9 ABAT-E-JOBABORT, Job aborted during execution

This is the exit status code of a job that has been aborted.

CFFD00CF ABAT-E-IMPERSONERR, Failure to impersonate client

This error can be returned if you attempt to connect to a Job Scheduler while the Scheduler is still in the process of starting. Please wait a moment and try again.

CFFD00DD ABAT-E-INVOPER, An invalid operation was specified

Either: an invalid context was specified on an enumeration, or an invalid operation was specified based on a job current state. For example, attempting to release a job which isn’t held.

CFFD00EC Database Error: Communications Error This error usually indicates that insufficient resources have been allocated for the Database server.

CFFD00F9 ABAT-E-NOTGENERIC, This is not a generic queue, unable to associate execution queues

Self-explanatory. Check queue properties.

CFFD00FA ABAT-E-INSUFFPRV, Insufficient privilege to perform Batch Queue Management operation

You attempted to perform a queue or job operation for which you lack sufficient access permissions.

CFFD0100 ABAT-E-INITSD, Failure to initialize ABAT Security Descriptor

This is an internal error indicating a failure to create a security descriptor the object. This error may be logged to the product’s trace file.

CFFD015E ABAT-E-ASSOCNOTFND, Failure to determine file association

The Execution Agent was unable to find the job file’s extension to program association. The job was not run.

CFFD015F ABAT-E-CRELOGFILE, Failure to create log file

The Execution Agent was unable to create the batch job’s log file. Typically, the log file specification is not valid or proper. Please check the log file specification and ensure it can be created from the Execution machine.

CFFD0160 ABAT-E-OPENCMDFILE, Failure to open command procedure

The Execution Agent was unable to open the batch job’s script file. Please check the main job’s file specification and ensure it can be opened from the Execution machine.

CFFD0161 ABAT-E-LICENSEXP, license has expired The evaluation serial number has expired. Please contact ASCI or your distributor for an extension.

CFFD019A ABAT-E-JOBSCHEDFAIL, Job Scheduler failed to start

This is the exit status code of a Job Scheduler Service which could not be

Page 180: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

170

Value (hex) Message Description/Action started. Check the trace file or NT Application Event Log for more information.

CFFD019C ABAT-E-NOTCONNECTED, A connection has not been successfully made to a Job Scheduler

You have attempted to perform an operation that requires a current connection to a Job Scheduler machine. Please make the connection and try again.

CFFD019D ABAT-E-ITEMALREADYEXISTS, The item being added to the collection already exists

This general error indicates that you are attempting to add an object to a collection and the object already exists. For example, trying to add the same account and access to a security collection.

CFFD01A2 ABAT-E-SERVERCOMMUNICATIONERROR, There was an error that occurred while communicating with the server

The client interface encountered an error while communicating with the Job Scheduler.

CFFD01A5 ABAT-E-REQPROPERTYINV, The required property %1!s! is either absent or invalid

Self-explanatory.

CFFD01A8 ABAT-E-FILESIZEERROR, The file being copied is larger than the system policy allows for

The ActiveBatch Administrator has prevented your file from being copied to the Execution Machine through the System policy CopyScriptMax

CFFD01A9 ABAT-E-JOBHISTORYERR, History information for the requested job could not be found

This is an internal error indicating that the Job’s History information could not be retrieved.

CFFD01AE ABAT-E-DEPENDFAIL, dependency failure The Batch Job failed because a job dependency could not be satisfied.

CFFD01B5 ABAT-E-PROPERTYREADONLY, You cannot modify this job because it is set as Read Only

Self-explanatory.

CFFD01C4 ABAT-E-EXCRUNTIME, job aborted exceeding expected run time

The Execution Agent has set this job’s exit status code because of an overrun for elapsed run time and has aborted the job.

CFFD01C5 ABAT-E-EXCCPUTIME, job aborted exceeding expected cpu time

The Execution Agent has set this job’s exit status code because of an overrun for CPU time and has aborted the job.

CFFD01C6 ABAT-E-INVHISTPROP, Job save history duration must be greater or equal to the log file retension period

Self-explanatory.

CFFD01CA ABAT-E-BATCHSTARTERR, unable to launch Batch Start job

A job completed and had a Batch Start (Success or Failure) action associated with it. That action could not be performed. Additional information accompanies this message indicating more specifically what the problem was.

CFFD01D1 ABAT-E-EXECABORT, job aborted due to Execution Agent failure

A job was aborted when an Execution Agent/machine failed. The job was not marked as being restartable.

CFFD01D3 ABAT-E-MAXEAGENTLIC, The maximum number of execution agent licenses has

This licensing error indicates that the maximum number of Execution Agent

Page 181: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

171

Value (hex) Message Description/Action been met licenses has been reached. Count each

Execution Machine you are attempting to connect to (regardless of whether the machine is active or the queue is started) and then compare against the value reported by the ABATLIC program.

CFFD01D4 ABAT-E-MSONLYLIC, This Job Scheduler license only permits connections to Microsoft Execution Agents

You are attempting to connect to a non-Microsoft Execution Agent and your license only permits you to connect to Microsoft Execution Agents.

CFFD01D7 ABAT-E-DUPLICFND, A duplicate license was found. Please ensure that all licenses are valid and unique.

This serious error usually indicates some level of license tampering. Please run the ABATLIC program to obtain more information.

CFFD01DA ABAT-E-LOCALONLYLIC, This Personal Edition license is only permitted to communicate with a single Execution Agent on the Local Machine.

When using the Personal Edition license you are restricted to a Workstation/Professional NT system and all connections are local to that system.

CFFD01DF ABAT-E-UNEXPEXCEPTCOM, An unexpected exception has occurred in the COM client

Self-explanatory.

CFFD01E4 ABAT-E-TAKEOWNERFAIL, attempt to take ownership of specified object failed

Your attempt to take ownership of this object failed. Verify that you have “Executive” level permission.

CFFD01E5 ABAT-E-GETOWNER, unable to obtain object owner

ActiveBatch is unable to retrieve the owner of the object. This error may appear if the domain of the owner’s account is not available.

CFFD01EA ABAT-E-DBPURGEFAIL, An error occurred while running the DBPurge process. Please examine the NT Event Log/DBPurge Log for further details

Self-explanatory. This error message concerns the running of the DBPurge facility to prune unneeded jobs from the ActiveBatch system.

CFFD01EB ABAT-E-AUDPURGEFAIL, Failed to purge Audit ID %1!d!

This DBPurge message can appear in the NT Application Event Log and indicates that DBPurge was unable to remove old audit messages from a specific job.

CFFD01EC ABAT-E-INSTSKIPPED, instance skipped due to active instance

This audit message indicates that a job instance could not be executed because the template’s property did not allow multiple concurrent copies of the job to run simultaneously.

CFFD01ED ABAT-E-INSTWAITFAIL, active instance wait failed

This audit message indicates that a job instance could not be executed because the “If Job Active… Wait” property was enabled and the timeout period expired.

CFFD01F9 ABAT-E-WRKSTNONLYLIC, The Personal Edition license is only permitted to run on a Workstation Platform

Self-explanatory.

CFFD01FC ABAT-E-RUNJOBINTERACTIVE, Unable to run the job interactively

An error occurred while attempting to run this job interactively. The error is

Page 182: ActiveBatchTM Developer s Guide - · PDF file4 ACTIVEBATCH CONSTANTS ... Listing 10 – WMI Sample Query for All ActiveBatch Events .....27 Listing 11 – WMI Sample Query for Job

ActiveBatch Developer’s Guide

172

Value (hex) Message Description/Action most likely due to a lack of desktop permissions.

CFFD01FF ABAT-E-INVCALCONFIG, An invalid Calendar configuration was made. Please make sure that all the calendar will allow a job to run at least once

You have attempted to create a job and schedule combination in which the job will never run. For example, scheduling a job on December 25th and then assigning a Calendar with Christmas as a holiday.

Table 219 - ActiveBatch Messages (Numeric)