Relation graphs

Introduction to relation graphs in ConSol CM

Relation graphs are a way to visualize relations between cases, contacts and resources in ConSol CM. They can be displayed in all Web Client sections which contain relations. In addition, it is possible to create a dedicated section with a customized relation graph.

Concepts, terms and definitions

Concept

Other terms

Definition

relation

 

Connection between two objects in ConSol CM. The objects can be of the same or of different types.

Purpose and usage

The content of Web Client sections containing relations can be displayed either as a list or as a graph. The user can select a display mode by clicking the Graph or List link in the section header.

Relation graphs show the relations of the current object (case, contact or resource) as a graph, i.e. each object is a node indicated by an icon and there are edges between the related objects. The nodes and edges have labels to indicate the object and kind of relation.

Relation graphs have the following purposes:

Relation graphs are based on the Network library of vis.js, see https://visjs.github.io/vis-network/docs/network/.

The following figures show the Relations section of a case in list and graph mode. In the graph mode, a case which is not related to the current case but to a related case is also shown.

Figure 23: ConSol CM Web Client - Regular display of the section with related cases

Figure 24: ConSol CM Web Client - Graph displayed in the section with related cases

Available settings

Sections to display relations graphs

Relation graphs are available for all sections which contain relations.

The graph display can be enabled in the page customization, see Enabling relation graphs. By default, it shows the direct relations between the current object and other objects and some second-level relations. You can extend and change the display, see Modifying a relation graph.

You can add a custom section with a relation graph to case, contact and resources pages. The content of this graph is not predefined, you need to provide it in a script, see Adding a custom section with a relation graph.

Available configuration parameters

The following attribute are is available for most kinds of relations:

Relations on case pages

Relations on contact pages

Relations on resource pages

Basic tasks

Enabling relation graphs

By default, the relation graphs are disabled, e.g. the Graph link is not shown. Please proceed as follows to enable relation graphs:

  1. Log in as administrator.
  2. Open the page where you would like to display a relations graph.
  3. Click Enable page customization in the main menu.
  4. Locate the type relationGraph in the page customization section and open the subscope of the section where the graph should be displayed.
  5. Set the attribute graph to On (the section is displayed as a list by default) or Default (the section is displayed as a graph by default). In both cases, the user can switch the display.

Advanced tasks

Modifying a relation graph

There are two ways to modify a relation graph:

Script coding

The script used to define a relation graph needs to return an object of the class RelationGraph. Use the methods of the class RelationCriteria to define the scope of the graph, i.e. kinds of relations shown and depth (how many levels of relations of related objects). Optionally, you can define the layout of the graph with the classes RelationNode and RelationEdge. The method load() of the class RelationService is needed to load the graph. See the ConSol CM API documentation for further details.

Depending on the page where the graph is displayed, the following objects are implicitly available in the script:

Adding a custom section with a relation graph

You can add a dedicated section which contains a relation graph to case, contact and resource pages. Please proceed as follows to create such a custom section:

  1. Log in as administrator.
  2. Open the page where you would like to add the new section.
  3. Click Enable page customization in the main menu.
  4. Locate the type section in the page customization section and open the subscope customRelationGraphSection.
  5. Set the attribute state to either collapsed or expanded.
  6. Locate the newly created type customRelationGraph and make the following settings:
    • Enter the name of the script of the type Relation graph, which returns the graph configuration, in the attribute graphScriptName.
    • Enter the text which should be displayed in the section header in the attribute sectionHeader.
    • If needed, modify the height of the section in the attribute sectionHeight, so that the relation graph fits into the section. The default value 0 means that the default height is used.

The displayed graph depends entirely on the provided script, which can access the complete ConSol CM API.

Example script which shows the relations of the current resource and the relations of the related resources:

import com.consol.cmas.common.model.relation.*

 

//create criteria using java api

def relationCriteria = new RelationCriteria()

.withResourceTickets(new RelationCriteria.ResourceTickets()

.withMaximumStepsFromRoot(2))

.withTicketResources(new RelationCriteria.TicketResources()

.withMaximumStepsFromRoot(2))

.withResourceUnits(new RelationCriteria.ResourceUnits()

.withMaximumStepsFromRoot(2))

.withResourceResources(new RelationCriteria.ResourceResources()

.withMaximumStepsFromRoot(2));

 

//variables available in script: ticketId, unitId, resourceId (depending on page)

def resource = resourceService.getById(resourceId)

def relationGraph = relationService.load(resource, relationCriteria);

 

//modify graph nodes, edges and visjs property

for (RelationNode node : relationGraph.getNodes()) {

node.withProperty("font", [size:9,color:"black"]) //change default property

}

for (RelationEdge edge : relationGraph.getEdges()) {

edge.withProperty("font", [size:12, color:"red"]); //change default property

}

relationGraph.withProperty("layout", [improvedLayout:true]) //change default property

 

return relationGraph;