Troubleshoot Guide | Debug a custom dependency type Description<!-- div.margin{ padding: 10px 40px 40px 30px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } .title { color: #D1232B; font-weight:normal; font-size:28px; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } ul{ list-style: disc outside none; margin-left: 0; } li { padding-left: 1em; } --> Description Dependency types are used to create a custom type through a script executing in real time. This will generate a custom view for a Dependency Views map of a specific CI. A JavaScript function needs to be created to customize the map. The script must comply with JavaScript syntax guidelines and the directions in the default script template, and it can call platform API's. Examples of usage of a dependency type: To narrow down and simplify a map, leaving out CIs that are not important for a specific task.To include only specific CIs that are hidden by default, such as qualifiers, end-points, and entry points.To display virtual relationships that are calculated, and that otherwise do not exist in the CMDB.As a tool to plan a new topology deployment that is based on existing resources. Procedure Navigate to Dependency Views > Dependency Types.In the Load Filter Scripts list view, select an existing dependency type, or click New.Enter or modify a script, adhering to the guidelines and requirements in the script template that is provided.Click Submit. How it works In a Dependency Views map, you can click Use Dependency Type to apply a custom script defined in a dependency type. Behind the scenes Dependency Type scripts are defined in the table ngbsm_script. The variables used and their definitions are listed here below: dv_ci_id : "Mandatory- Sys_id of the child CI"dv_rel_id : "Optional- Relation ID, a unique identifier for this relation (generated by the system by default)",dv_rel_type : "Optional- Stored ID of the relation type (1a9cb166f1571100a92eb60da2bce5c5 by default)",dv_rel_type_label : "Optional- Label of the relation (overwrites the default dv_rel_type label)",dv_downstream : "Optional- Indicates a downstream or upstream direction (true by default indicating a downstream direction)",dv_params : "Optional- Container for sticky parameters to be passed to this script at recurring calls (empty by default)",dv_messages :"Optional - Container for notifications to be send to the client [default-empty]" In the script we need to debug if we are getting the value from the above variables, and if they are passed as needed. When we use the Dependency Type, we may fail to read the value, hence debug statements can help us troubleshooting. Example: INPUT var dv_level = "System- Input parameter indicating the current depth, cannot be modified.";var dv_ci_id = "System- Sys_id of the parent CI node";var dv_params = "System- Container for custom sticky parameters to be passed to this script at every recursion (empty by default).";*/dependency_views_script();function dependency_views_script() { OUTPUT Result - contains an array of the parent(args[0]) children *[ {* "dv_ci_id" : "Mandatory- Sys_id of the child CI",* "dv_rel_id" : "Optional- Relation ID, a unique identifier for this relation (generated by the system by default)",* "dv_rel_type" : "Optional- Stored ID of the relation type (1a9cb166f1571100a92eb60da2bce5c5 by default)",* "dv_rel_type_label" : "Optional- Label of the relation (overwrites the default dv_rel_type label)",* "dv_downstream" : "Optional- Indicates a downstream or upstream direction (true by default indicating a downstream direction)",* "dv_params" : "Optional- Container for sticky parameters to be passed to this script at recurring calls (empty by default)",* "dv_messages":"Optional - Container for notifications to be send to the client [default-empty]"* }, … ] */var result = []; // <— Enter the script logic for the retrieval of the children./* example to define resultresult.push({"dv_ci_id" : "27d32778c0a8000b00db970eeaa60f16", //Represents the 'Email' CI"dv_rel_id" : "27eb80f3c0a8000b00587d37871ce04e", //Represents the link between Blackberry & Email"dv_rel_type" : "1a9cb166f1571100a92eb60da2bce5c5", //Represents the 'Depends on::Used by' relationship"dv_downsream" : "true", //Indicates a downstream link"dv_params" : {"test" : "1234"; //A custom parameter to be used in a recurring call of this script },"dv_messages": { "type":"info", "msg":"Testing Info Notification"} //Pass a notification to be displayed on the client [error,info] */return result;}