This documentation supports the 9.1 to 9.1 Service Pack 3 version and its patches of BMC Atrium Core. The documentation for version 9.1.04 and its patches is available here.

To view the latest version, select the version from the Product version menu.

Example- Walking multiple types of relationships for a CI instance using the CMDBGraphQuery function

Suppose that you start on a CI instance of class A:A with instance ID 1 and walk relationships of class A:rAB, which represents a relationship with an A:A instance as the source and an A:B instance as the destination. From A:B you want to walk relationship A:rBA, which has class A:B as the source and class A:A as the destination. You want to walk outward to the last level, so the value of the numLevels argument is -1. The instances of the CI and relationship classes have no qualifications. You are retrieving all of the attributes of the relationship instances and the CI instances.

Graphically, the query you want to walk is illustrated in the following figure. As with example 1, the graph for this query can be represented either as (a) or (b). In representation (a), the class A:A appears twice. To distinguish one instance of A:A from the other, an extensionId is needed. In this example, one of the instances is assigned the arbitrary extensionId of two.

Graph of Query Example 2

queryGraph data structures for Graph of Query example 2 (a)

queryGraph data structures for Graph of Query example 2 (b)

The path taken to walk this graph is shown by the bolded relationships in the following figure. The bolded nodes are those returned in the objects list.

The expected data to be returned is:

  • Six CIs. Three are instances of A:A with instance IDs 8, 5, and 9. Three are instances of A:B with instance IDs 1, 3, and 2.
  • Six relationships. Three are instances of A:rAB with instance IDs 1, 3, and 2. Three are instances of A:rBA with instance IDs 1, 2, and 3.

Path walked and nodes returned by Query Example 2

Was this page helpful? Yes No Submitting... Thank you