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 a specific type of relationship 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:rAA, which represents a relationship with A:A instances on both ends. You want to walk outward to the last level, so the value of the numLevels argument is -1. The instances of A:rAA and A:A have no qualifications. For return data, you are retrieving all of the attributes of the relationship instances and the CI instances.

Graphically, the query that you want to walk is illustrated in the following figure. For the same query, the graph 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, you need an extensionId. In this example, one of the instances is assigned the arbitrary extensionId of two.

Graph of query example 1


The following figure, queryGraph data structures shows the data structures of the queryGraph argument for the above figure, Graph of query example 1 (a).

queryGraph data structures for Graph of query example 1(a)


The following figure, queryGraph data structures shows the data structures of the queryGraph argument for the above figure, Graph of query example 1 (b).

queryGraph data structures for Graph of query example 1(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:

  • Seven CI instances of A:A with instance IDs 2, 3, 8, 4, 5, 6, and 7.
  • Eight relationship instances of A:rAA with instance IDs 1, 2, 3, 4, 5, 9, 6, and 7.



Path walked and nodes returned by query example 1

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

Comments