Pattern Operation Create relation/reference does not create relation

gk13
Tera Expert

 I need to create a relation from records in [cmdb_ci_appl_sap_ci] to records in [cmdb_ci_database]. Therefore I added an extension section to the pattern “SAP CI Application”. In there I gather all the needed information and use the Create relation/reference operation to build that relation.In the Debug mode that step returns all necessary information to build the relation:

 find_real_file.png

 find_real_file.png

 

If the step is run in TopDown Disocvery it returns nothing and the relation is not build – any idea why?

 find_real_file.png

4 REPLIES 4

doug_schulze
ServiceNow Employee
ServiceNow Employee

Tough to decipher from the description but you dont build ref/relations between tables, its between records in those tables.  In your pattern have you populated a database record?  And if so, why is it not in a proper child table such as oracle or MSSQL?

gk13
Tera Expert

Doug, you are absolutely right. The relation we need to build is not between tables but between a database record and a SAP CI Application record. And yes both the database and the SAP CI application record are populated with all the neccessary information.

Because of the way we like to display the (clustered) database in the Dependency View we chose the Database class [cmdb_ci_databe] as a parent for the Oracle instances [cmdb_ci_db_ora_instance]. But irrespective of the class we put the DB in the relation should be build or am I wrong here?

As already mentioned the debug test runs ok but if the pattern is run in a service discovery that step returns zero - see screenshot in post. Are there any more options on how to debug that than the pattern log?

gk13
Tera Expert

Well my experience is that if the pattern is run in top down/application discovery (Service Mapping) the relation is somehow not build. But if the pattern is run during a horizontal discovery (Disco) then the relation is build as expected. I don't have a really good explanation for this and don't know why the pattern seems to be treated differend depending on the tye of disocvery

stephane_P
Tera Contributor

I can confirm that the "create relation/reference" only applies to horizontal discovery. I had the same issue where I could not get it to work with top-down but when I ran the same pattern with horizontal, it was working. I logged a call with SN and asked them to confirm with the dev team and they mentioned the following:

"straight from development:
service mapping patterns only discover a single CI so "create relation/reference" doesn't work with them and is only relevant for horizontal patterns."

 

I must admit I don't understand what the developer says when he mentions "service mapping patterns only discover a single CI so...." (as my understanding is that if the CI is not found, Service Mapping uses discovery to discover the CI and thus I understood by that that SM does not actually discover any CI) but that's ok.

 

As well, when I use debug on the pattern and generate the payload, I see it creates the relation and when I run horizontal discovery, I see a post-processing step that process the payload whereas this step is missing in the log for top-down discovery so that may be why.