Links are elements of the data model that define relationships between data types and data items.
Static links define relationships between data items, and dynamic links define relationships between data types. Links are an optional component of the Netcool/Impact data model.
Dynamic links
Dynamic links define a relationship between data types.
This relationship is specified when you create the link and is evaluated in real time when a call to the GetByLinks function is encountered in a policy. Dynamic links are supported for internal, SQL database and LDAP data types.
The relationships between data types are resolved dynamically at run time when you traverse the link in a policy or when you browse links between data items.
They are dynamically created and maintained from the data in the database.
The links concept is similar to the JOIN function in an SQL database. For example, there might be a 'Table 1' containing customer information (name, phone number, address, and so on) with a unique Customer ID key. There may also be a 'Table 2' containing a list of servers. In this table, the Customer ID of the customer that owns the server is included. When these data items are kept in different databases, Netcool/Impact enables the creation of a link between Table 1 and Table 2 through the Customer ID field, so that you can see all the servers owned by a particular customer.
You can use dynamic links only at the database level. (When relationships do not exist at the database level, you needs to create static links.) You can create dynamic links for all types of data types (internal, external, and predefined). See Chapter 6,
“Configuring data types,” on page 69 for information about the kinds of data type.
Dynamic links are unidirectional links, configured from the source to the target data type.
Static links
Static links define a relationship between data items in internal data types.
Static links are supported for internal data types only. Static links are not supported for other categories of data types, such as SQL database and LDAP types, because the persistence of data items that are stored externally cannot be ensured.
A static link is manually created between two data items when relationships do not exist at the database level.
With static links, the relationship between data items is static and never changes after they have been created. You can traverse static links in a policy or in the user interface when you browse the linked data items. Static links are bi-directional.
Working with dynamic links
Dynamic links use a specified method to link data items of the source data type to the data items of a target data type.
The linking methods are described:
Table 89. Linking Methods Link
By: Description
Key This method evaluates an expression from one data type and matches this to the Keyfield of the target data type.
Filter This method uses a filter expression to describe the link between any fields in the source type to any fields of the target data type.
Policy This method runs a specified policy to look up data items in the target and link all the retrieved data items to data items of the source type.
Creating dynamic links
Use this procedure to create a dynamic link.
Procedure
1. To open the Data Type editor, click a data type name.
2. In the Data Type editor, select the Dynamic Links tab.
3. You can create the following types of dynamic links:
v Link By Filter. For more information abut creating links by filter, see
“Adding new links by filter.”
v Link By Key. For more information abut creating links by key, see “Adding new links by key” on page 107.
v Link By Policy. For more information abut creating links by policy, see
“Adding new links by policy” on page 108.
4. Click OK and click Save on the main to tab to implement the changes.
Adding new links by filter
Use the following procedure to add a new link by filter.
Procedure
1. Click New Link by Filter.
2. Enter the information in the New Link By Filter window, using this table as your guide:
Table 90. New Link by Filter Window Window element Description
Target Data Type Select the target data type from the list.
Exposed Link Type Select a link to follow from the list. The target data type name (in other words the exposed link) and the link type data items that match this source and target. See “LinkType data types” on page 95.
Table 90. New Link by Filter Window (continued) Window element Description
Filter A filter is an expression that specifies which fields in the source and target types have to match in order for a link to exist. It can be either a simple expression (source name = target name) or a complex expression defined by a Boolean operator that indicates the order of the operation:
(Custname = ’%customer%’) AND (device_num = %DeviceNumber%) The link appears in the New Link By Filter table in the Dynamic Links tab.
3. Click OK and click Save on the main to tab to implement the changes.
Adding new links by key
When you define a Link by Key dynamic link, you specify a field in the source and target data types that contains a matching value.
Procedure
1. Click New Link by Key.
2. Enter the information in the window, using this table as your guide:
Table 91. New Link by Key window Window element Description
Target Data Type Select the target data type from the list. For example, User.
Exposed Link Name Select a link to follow from the list. For example, User. The target data type name (in other words the exposed link) and the link type data items that match this source and target.
Foreign Key Expression Type the foreign key expression, for example: LastName + ", "
+ FirstName
For more information about foreign key expression, see
“Foreign key expressions.”
The new link appears as a row in the New Link By Key table in the Dynamic Linkstab.
3. Click OK and click Save on the main to tab to implement the changes.
Foreign key expressions
You can build the expression from one or more fields.
Type a field name or combination of field names in the source type that match the Key field in the target type. For example, if you want the key into the source type to be a field called 'NodeName', you enter NodeName. You can enter more than one field by entering the characters ’+’ ’+’ to join them.
For example, if the source type has a FirstName field and a LastName field and the target Key field is Name, you can create the link by entering the following expression:
FirstName + ’ ’ + LastName
The expression is applied to the following field value pairs, for example, if in the source the fields are:
FirstName = ’John’
LastName = ’Doe’
The resulting value for the target Key field (Name in this case) is:
Name = ’John Doe’
this matches to:
’John’ + ’ ’ + ’Doe’ = ’John Doe’
Adding new links by policy
Use this procedure to add a new link by policy.
Procedure
1. Click New Link by Policy.
The New Link By Policy window opens.
2. Enter the information in the window, using this table as your guide:
Table 92. Internal Data Type - New Link by Policy window Window element Description
Target Data Type Select the target data type from the list. For example, LinkPolicy.
Exposed Link Type Select a link to follow from the list. For example, LinkPolicy.
The target data type name (in other words the exposed link) and the link type data items that match this source and target.
Policy to execute to find links
Select a policy from the list of available policies. For example, GetPolicy.
The new link appears as a row in the table in the Dynamic Links tab.
3. Click OK and click Save on the main to tab to implement the changes.
Editing dynamic links
Use this procedure to edit a dynamic link.
Procedure
1. To edit a link, click the Edit in the row of the link you want to edit.
2. Make any necessary changes.
See “Working with dynamic links” on page 106 sections for more details.
3. Click OK and click Save on the main to tab to implement the changes.
Deleting dynamic links
Use this procedure to delete a dynamic link.
Procedure
1. In the Select: column, select the links that you want to delete. Check marks are placed in the check boxes next to the selected links and the links are highlighted.
If you want to delete all the links in the table, click the All link. Check marks are placed in every check box in the Select: column and the data links are highlighted. You can clear the check boxes for the individual data links if you decide you do not want to delete them.
2. Click the Delete link to delete the selected links.
Browsing dynamic links
You can browse dynamic links by using the Dynamic Links Tree Viewer.
Procedure
1. To browse links for internal, external and pre-defined data types, locate the data type you want to browse.
2. Click View Data Items next to the data type to open the Data Items Editor in the Main Work panel.
3. Locate the data item you want to see links for and click View Linked Data Items Browserto open the browser.
4. Click the plus sign next to the top-level links to view child links.
5. Click a data item to see more detailed information about the event.
6. Click the x to close the browser.
Working with static links
You can view static links and create a static link between the data items of internal data types.
Creating static links
Use this procedure to create a static link for an internal data type.
Procedure
1. Open the Global tab.
2. In the data navigator, locate the source internal data type, and click View Data Items.
The Data Item editor opens in the Main Work panel.
3. Click the Links icon in the Links column next to one of the data item rows.
The Link Editor window opens.
4. Select Target Type of Linked Items from the selection list.
Only Internal and Predefined data types show in the list.
5. To add a link, highlight the data items you want that are listed in the Unlinked Data Itemslist and click Add.
The items move to the Linked Data Items and LinkTypes list.
6. To remove a link, highlight the data items that you want to remove from the Linked Data Itemslist and click Remove.
The data items are returned to the Unlinked Data Items list.
7. Click OK to save and close the editor.