- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 07-05-2021 05:26 AM
Add and populate related CIs and connect them together
This lab explains how to create related CIs using the pattern and connect them together according the Identification Engine rules.
In this lab, you will learn
-
How to populate related CIs in the pattern
-
How to use the relation/reference in the pattern to connect the CI's together.
Select Pattern Designer Discovery Patterns.

In the Search filter, enter *Bagpipe.

Click the displayed pattern and select the discover link in the Identification section (as previously) to navigate into the pattern designer.

Reconnect again by pressing on the Debug Mode button

In the popup window, enter BagpipeDemo in the BagpipeName field.
Click Connect.

Right click step 3 and select New step below.

Name the new step Get Drones Data.
Choose the Set Parameter Value operation, and set the following JSON in the value:
{
\"items\": [
{
\"name\": \"Tenor drone1\",
\"identifier\": \"drone1\"
},
{
\"name\": \"Tenor drone2\",
\"identifier\": \"drone2\"
},
{
\"name\": \"Bass drone\",
\"identifier\": \"drone3\"
}
]
}

Right click again and select New step below.
Rename the step Parse Drones Data
In the Operation field, enter Parse Variable
In the Enter Variable field, drag and drop the $drone_row variable, and click Retrieve.

Parse the drone data into a raw table, as you did for the bagpipe data.
Change the parsing strategy to JSON File,
Define the table and highlight the name and identifier values.
Name the table drone_raw_table.

Populate the drone CI table, as follows:
Create a new step as described above, and rename it Populate Drone CI.
In the Operation field, enter Transform Table.
Modify the source table value to $dron_raw.
Modify the target table value to $u_cmdb_ci_drone by dragging and dropping from the related CIs into this field.
Add the following fields and values:


Verify that you have populated the Drone CI by checking the Chanter CI located in the right side of the pattern:

Click Save to ensure that you do not lose your work
Click Publish. Your pattern saves into the DB and is synchronized into the MID.
Perform the same operation for the Chanter CI. Repeat the same operation you did for the Bagpipe CI; see the following XML:
<root>
<entity>
<name>bagpipe_chanter</name>
</entity>
</root>
Set the Operation field value to Parse Variable.
In the Define Parsing field, select XML file.
Populate the Chanter CI so it looks as follows:


Create the whistle CIs. (Without the whistle, the drones do not make any noise!!!!!)
Use this XML and create the Whistle CI exactly as you create the drones.
<root>
<entity>
<whistle>
<name>Drone Tenor Whistle1</name>
<identifier>drone1</identifier>
</whistle>
<whistle>
<name>Drone Tenor Whistle2</name>
<identifier>drone2</identifier>
</whistle>
<whistle>
<name>Drone Bass Whistle</name>
<identifier>drone3</identifier>
</whistle>
</entity>
</root>
As you did to the drone, add new steps to set parameter value, parse it and populate the whistle.

Populate the whistle CI as follows:

Verify that it appears as follows:

Verify as you did for the drones that the whistle CIs are populated; navigate to last step in the pattern and look at the related CIs:

Now comes the interesting part, to connect the CIs together according the identification engine rules. Following is the diagram of the CIs and their relations:

We will create the relations according this definition.
Connect the Chanter to the Bagpipe.
Important!
Pay attention to which CIs you put in the parent and child fields because this should match the definition of the relationship we defined in the meta data editor.
Right click and add new step (as you did previously), and name it Relation/Reference chanter and bagpipe and choose Create Relation/Reference step.
Configure the following:

For the Creation Criteria condition, you can configure 1 equals 1, as shown below:

Navigate to the next step to verify what you have configured.
Click the icon in the top right corner:

Relations and references connected to the CI are displayed.

Connect the drones CIs to the bagpipe in the same way the Chanter CI is connected.
Right click and add a new step (as you did previously) and name it Relation/Reference drone and bagpipe and choose the Create Relation/Reference step.
Configure the following:


Navigate to the next step as you did for the Chanter and verify that the drones are connected to bagpipe CI:

Connect the Whistle CIs to the drones in the same way as you connected CIs to the Bagpipe; ensure that here, you connect the CIs to the drone.
Right click and add a new step (as you did previously) and name it Relation/Reference drone and whistle and choose the Create Relation/Reference step.
Configure the following:

To set the condition to match the relevant whistle and drone, select Field matching in the Creation Criteria field.
The parent and child fields should be "identifier"

After connecting all the CIs together, execute the pattern again.
Navigate to Discovery Schedules Bagpipe Discovery and click the Discover now link.

After executing the pattern, navigate to the Discovery Log tab to verify that the pattern ran successfully.

Click the Here link in the Discovery log to redirect to the Pattern Log page.

Select the Devices tab and click the BagpipeDemo CI; the Bagpipe CI form appears, and the Related Items CIs displays all the CIs connected to it:

Right click the gray area of the form and choose Configure Related lists to view the drones and chanter CIs as related lists to the bagpipe.

Add the drone and chanter to the Selected list:

Click Save. The drone and chanter appear on the Bagpipe form:

Click the Show dependency views icon.

The following dependency view appears:

- 1,277 Views