2016/05/04
4 May, 2016

[Article] Dependency Visualization with WSO2 Governance Registry

  • Sameera Kannangara
  • Software engineer - WSO2
Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.

Table of contents


Applies to

WSO2 Governance Registry Version 5.2.0 and above

Introduction

WSO2 Governance Registry allows you to have an overall vision of your operational artifacts while governing them, by specifying their relationships. In order to do this, WSO2 Governance Registry uses elements called associations. These associations are characterized by three attributes named source resource, destination resource and association name. Any defined association is considered directional since two artifacts are associated by specifying the source and destination artifacts.

This article will discuss the functionality of the dependency graph; a new feature introduced in WSO2 Governance Registry Publisher view. This feature provides a graphical view of associations relating to a given artifact in the form of a graph.


How to access the dependency graph

In order to access the dependency graph of a desired artifact, it should first be viewed in the asset view of WSO2 Governance Registry Publisher. By clicking on the Show Dependencies button in asset view, the dependency graph will be displayed.

Figure 1

By default, the dependency graph related to the specified artifact will open in a new tab. You will see an interface similar to figure 2 below.

Figure 2

In figure 3 below, the dependency graph begins from the governance artifact “CD_store.wadl”. Therefore it’s represented with an enlarged icon node. Since “CD_store.wadl” has only one association, that artifact is shown on the graph as a smaller icon node. The association between the two artifacts is shown as an edge between the nodes. By hovering over the small circle in the middle of the edge, the represented associations can be viewed.

Figure 3


Example use case

We will use the “BuyMore” sample scenario described in WSO2 Governance Registry 5.2.0 Quick Start Guide. You can follow the steps provided to populate the governance registry. In this sample scenario the dependency graph is used to monitor a REST service’s dependencies before making it obsolete.


Functionality

In order to explain the functionality of this feature we’ll be using a dependency graph created with "BuyMore". By following the same steps used to generate the dependency graph for "BuyMoreBillCalculateRESTAPI" v1.0 in the getting started sample, the graph shown in figure 4 can be derived by using the “BuyMoreBillCalculateRESTAPI” version 1.0.0 RestService.

Figure 4

In figure 4 above, the larger node represents the artifact used to generate the graph while smaller nodes represent other artifacts that are related to the larger artifact either directly or via the larger artifact’s children. By hovering over the small circle on each edge, associations represented by each edge can be viewed. Associations will be listed with association name and the direction of the association.

Figure 5

In order to view artifacts directly related to a given artifact, you need to click on the artifact and the nodes and edges that are directly connected to that node will be highlighted while other nodes will be shaded. In figure 6 the “BuyMoreBillCalculateRESTAPI” version 2.0.0 artifact is selected, highlighting only the artifacts that are directly connected to it.

Figure 6

Let’s consider another instance where “BuyMoreBillCalculateRESTAPI” version 1.0.0 artifact is selected. This action will result in the graph shown in figure 7 below, which highlights only artifacts that are directly connected to the “BuyMoreBillCalculateRESTAPI” version 1.0.0.

Figure 7

To access the detailed view of an artifact node, you can simply double click on the desired artifact to open it in the publisher. For example, if you double click on the ‘calc-swagger’ version 1.0.0’ artifact, the detailed view shown in figure 8 will be opened in a new tab.

Figure 8

In order to zoom in and out of the dependency graph, you can click on the + and - signs located at the top right corner. The mouse wheel operation can also be used to do this. By dragging and dropping the dependency graph, you can pan inside the graph area. Both these actions - zooming and panning - change the graph’s original positioning on the display area. In order to reset the graph to its original position, you need to click on the ‘Zoom out to fit screen’ button located directly below the zoom.


Locating artifacts in the graph

If the developed graph has a considerably large number of nodes, then it would be quite hard to find a single artifact among nodes. If you know entire name of the artifact or even a part of it, the locate artifact functionality can be used to find the node in the displayed graph. By clicking on and typing the name in the box labeled ‘Find Resource’, you will be presented with a dropdown list containing all the resource names. When typing the name into the textbox only the names containing the typed literal, will be displayed.

Figure 9

Upon selecting an artifact name from the list, the node representing that artifact will be panned to the center of the display area.


Association filtering

Associations displayed in the dependency graph can be filtered based on the association name by clicking on the association names listed near the top left corner of the view. Initially all the association types are listed and tick marks will be present next to each association name. Displaying these association types can be enabled and disabled by clicking on the association name.

Figure 10


Exporting the dependency graph as an image

The generated dependency graph can be downloaded as an image by clicking on the Save button on the top left corner of the view. This function exports the dependency graph rendered in the current display area as a .png image. Since it exports only visible parts, the graph can be zoomed and panned to display only the required portion in the visible area.

Figure 11

An image similar to the one showed in figure 11 above can be downloaded if you require an image of the entire graph. To get only a required section the ‘api-docs.json’ node should be panned to the middle of the display and zoomed in until only the direct associations of the node are visible. When you click on Save button in this state the image shown in figure 12 is downloaded.

Figure 12


Settings related to dependency graph

Even though the dependency graph generated for this example is small and manageable, it is possible that relationships related to some governance artifacts can result is quite complex graphs. This may result in rendering issues. In order to restrict the graph size we have introduced a parameter to specify the maximum depth of the graph. This parameter restricts the maximum number of edges that are considered for the graph generation. By default in WSO2 Governance Registry no limits are specified for the maximum depth so it generates and renders the complete graph. However by specifying <dependencyGraphMaxDepth>{integer-depth-value}</dependencyGraphMaxDepth> element inside <wso2registry> element of <G-Reg_home>/repository/conf/registry.xml file, the graph’s maximum depth can be limited.

For instance let’s consider the above example related to “BuyMoreBillCalculateRESTAPI” version 1.0.0. Figure 13 depicts the graph generated without any depth restriction.

Figure 13

With <dependencyGraphMaxDepth>0</dependencyGraphMaxDepth>, the graph in figure 13 is shown.

Figure 14

With <dependencyGraphMaxDepth>1</dependencyGraphMaxDepth>, the graph in figure 14 is shown.

Figure 15

With <dependencyGraphMaxDepth>2</dependencyGraphMaxDepth>, the graph in figure 15 is shown.

Figure 16


Conclusion

WSO2 Governance Registry is a tool that represents governance artifacts of an organization and specifies relationships among those artifacts. By specifying these relationships it’s easier to track how artifacts relate to each other as a whole and to analyze how a desirable governance artifact affects or is affected by other artifacts. Rather than making dependency analysis a series of traverses over artifact representations, the dependency graph feature in WSO2 Governance Registry provides a single unified graph view accumulating all the information regarding associations related to a desired artifact.


References

 

About Author

  • Sameera Kannangara
  • Software engineer
  • wso2