Example: add single row of custom data about existing entity
To add a single row of custom data, add the appropriate insert to the $NCHOME/etc/precision/DbEntityDetails.cfg configuration file.
Inserting data discovered using the File finder, a discovery agent, or collector
The following insert adds a single row of custom data about an existing entity. In the mapping,
the values on the left are the field names of a new table called exampleCustomData
.
The exampleCustomData
table must be created in dNCIM and NCIM. The eval statements
on the right take the values from the workingEntities.finalEntity
database table.
This data must already be discovered by using one of the methods for discovering custom data and
added to the workingEntities.finalEntity
database table.
In this example, service-level agreement data for a an existing entity is mapped to the custom
dNCIM table exampleCustomData
.
In this example, the data was discovered using the File finder, a discovery agent, or collector.
The data was added to custom fields within the m_ExtraInfo
field in the
workingEntities.finalEntity
database table.
insert into dbModel.entityMap
(
EntityFilter,
TableName,
FieldMap
)
values
(
"m_ExtraInfo->m_CustomerSLA IS NOT NULL",
"exampleCustomData",
{
entityId = "eval(int, '&m_EntityId')",
slaId = "eval(text, '&m_ExtraInfo->m_CustomerSLA')",
customerId = "eval(text, '&m_ExtraInfo->m_CustomerId')",
customerContact = "eval(text, '&m_ExtraInfo->m_CustomerContact')"
}
);
The table below describes the insert.
Line | Description |
---|---|
9 | Only add rows to the custom table where the
m_ExtraInfo->m_CustomerSLA custom field for the entity has a value. This filters
out entities that are not associated with a service-level agreement. |
10 | Add the rows to the custom dNCIM table
exampleCustomData . |
11-16 | Add the following data to each row:
|
Inserting data discovered using custom tag tables
The following insert adds a single row of custom data about an existing entity. In the mapping,
the values on the left are the field names of a new table called exampleCustomData
.
The exampleCustomData
table must be created in dNCIM and NCIM. The eval statements
on the right take the values from the workingEntities.finalEntity
database table.
This data must already be discovered by using one of the methods for discovering custom data and
added to the workingEntities.finalEntity
database table.
In this example, service-level agreement data for a an existing entity is mapped to the custom
dNCIM table exampleCustomData
.
In this example, the data was discovered using custom tag tables. Data discovered using custom
tag tables is added to custom fields within the m_ExtraInfo->m_CustomTags
field in
the workingEntities.finalEntity
database table.
insert into dbModel.entityMap
(
EntityFilter,
TableName,
FieldMap
)
values
(
"m_ExtraInfo->m_CustomTags->m_CustomerSLA IS NOT NULL",
"exampleCustomData",
{
entityId = "eval(int, '&m_EntityId')",
slaId = "eval(text, '&m_ExtraInfo
->m_CustomTags->m_CustomerSLA')",
customerId = "eval(text, '&m_ExtraInfo
->m_CustomTags->m_CustomerId')",
customerContact = "eval(text, '&m_ExtraInfo
->m_CustomTags->m_CustomerContact')"
}
);
The table below describes the insert.
Line | Description |
---|---|
9 | Only add rows to the custom table where the
m_ExtraInfo->m_CustomTags->m_CustomerSLA custom field for the entity has a value.
This filters out entities that are not associated with a service-level agreement. |
10 | Add the rows to the custom dNCIM table
exampleCustomData . |
11-16 | Add the following data to each row:
|