IBM Tivoli Software IBM Tivoli Software

[ Bottom of Page | Previous Page | Next Page | Contents | Index ]


Appendix B. Service object method library

This appendix describes the Class Object library, including the syntax used to express all main functions needed to create an object in a resource model. The appendix also lists guidelines for producing scripts and possible errors that can occur when you run a resource model.

The IBM Tivoli Monitoring Resource Model Builder enables you to program your own functions and create customized scripts. Customized resource models are less predictable, so it is essential to test your scripts thoroughly before distributing them.

Note:
The following methods are written in Visual Basic. You can write the same methods in JavaScript by modifying the syntax and complying with the code rules. The following table lists some examples of the same methods expressed in both languages:
Table 11. Visual Basic and JavaScript example comparisons
Visual Basic JavaScript
GetNumOfInst (ClassName As String) As Long int GetNumOfInst (String className)
GetNumProperty (ClassName As String, idxAs Long, PropName As String) As Double double GetNumProperty (String className, int index, String propertyName)
DefineClass (Source As String, AliasName As String, RealClassName As String, WhereClause As String, NumProps As String, StrProps As String, SortType As String, SortField As String, Top as long, Every as long) DefineClass (String source, String aliasName, String realName, String whereClause, String numProperties, String strProperties, String sortType, String sortField, int Top, int every)
The following table outlines the main differences between the two languages:
Table 12. Visual Basic and JavaScript language comparisons
Visual Basic JavaScript
Parameter name As Parameter Type. Parameter Type Parameter name.
The type of value returned by the function is expressed at the end of the function. Example: GetNumProperty(...) As Double The type of value returned by the function is expressed at the beginning of the function. Example: double GetNumProperty(...)
Not applicable Instructions end with a semicolon.

[ Top of Page | Previous Page | Next Page | Contents | Index ]