CIRelatedList - Global

Utility class for working with CI Related lists.

Each instance of this class contains the details of a single list that is related to a particular CI. The details of this list and the contents of the list are included.

Use with any server-side discovery script.

CIRelatedList - addRec(String record)

Adds the specified record to the related list.

Table 1. Parameters
Name Type Description
record String The record to add
Table 2. Returns
Type Description
void


      
    

CIRelatedList - addRecs(String records)

Sets the given records to the related list.

Table 3. Parameters
Name Type Description
records String The records to set
Table 4. Returns
Type Description
void


      
    

CIRelatedList - appendXMLChildFld(String parent, String name, String datum)

Appends an XML child to a field.

Table 5. Parameters
Name Type Description
parent String The parent element
name String The element name
datum String The data to append
Table 6. Returns
Type Description
void


      
    

CIRelatedList - appendXMLChildRecord(String parent, String name, String record)

Appends an XML child to a record.

Table 7. Parameters
Name Type Description
parent String The parent element
name String The element name
record String The record
Table 8. Returns
Type Description
void


      
    

CIRelatedList - checkSysM2M()

Checks to see if this is a Sys many-to-many table. If it is, sets the target table name and reference field name.

Table 9. Parameters
Name Type Description
None
Table 10. Returns
Type Description
Boolean True if it is a sys many-to-many table; otherwise, false.


      
    

CIRelatedList - checkSysCollection()

Checks to see if this is a SysCollection table. If it is, sets the target table name and reference field name.

Table 11. Parameters
Name Type Description
None
Table 12. Returns
Type Description
CIRelatedList An instance of CIRelatedList for the specified list.


      
    

CIRelatedList - CIRelatedList(String table, String refField, String cmdb_ci, String debugFlag)

Creates an instance of the CIRelatedList class. With no arguments, simply constructs an empty instance.

Table 13. Parameters
Name Type Description
table String The table containing the related list. If many-to-many, the many-to-many table.
refField String The reference field in the table for this related list.
cmdb_ci String The sys_id of the CI this list is related to.
debugFlag String If true, debug logging is enabled.


      
    

CIRelatedList - fromXML(String element)

Initializes this instance from the specified XML element.

Table 14. Parameters
Name Type Description
element String An XML element
Table 15. Returns
Type Description
void


      
    

CIRelatedList - populate()

Populates the this.records field of this instance.

Table 16. Parameters
Name Type Description
None
Table 17. Returns
Type Description
void


      
    

CIRelatedList - remove()

Removes all the related list items.

Table 18. Parameters
Name Type Description
None
Table 19. Returns
Type Description
void


      
    

CIRelatedList - toString(Array result)

Makes a string representation of this instance, pushing each line onto the end of the given result array.

This method is called from CIData.toString(), and assumes related list lines are to be indented two spaces.

Table 20. Parameters
Name Type Description
result Array The result to convert
Table 21. Returns
Type Description
void


      
    

CIRelatedList - toXML(String document, String element)

Serializes this instance to XML in the given document and <rl> element.

Table 22. Parameters
Name Type Description
document String The document
element String The rl element
Table 23. Returns
Type Description
void


      
    

CIRelatedList - xmlToRecord(String records, String element)

Converts a related list from XML to record format.

Table 24. Parameters
Name Type Description
records String The record to create
element String The XML element
Table 25. Returns
Type Description
void