The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Business Rules : "Detected recursion" when creating relationship using IRE

Amar_Be
Kilo Sage

HI,

 

At the creation of a CI into the CMDB, I want to create a relationship to a server CI.

The CI is created by the ServiceGRaph Connector For Azure (IntegrationHub ETL).

I'm using a business rule that run on "AFTER" "Insert".

In this business rule, I retrieve the sys_id of the Child (the current record that triggered the BR) and the Parent CIs.

Then I build a payload and call the IRE to create the relationship

var ireoutput = sn_cmdb.IdentificationEngine.createOrUpdateCIEnhanced(discoverySource,irepayload, {});
 

But calling the IRE from a business rules AFTER INSERT trigger an error : 

 

"Stack trace:
at sys_script.7c166a402bcca690c630fdb0de91bf48.script ➚ ➚:38 (executeRule)
at sys_script.7c166a402bcca690c630fdb0de91bf48.script ➚ ➚:43
Root cause of JavaScriptException: java.lang.RuntimeException
: java.lang.RuntimeException: Detected recursion, aborting...: com.snc.cmdb.identify_reconcile.IdentificationEngine.createIdentificationEngine(IdentificationEngine.java:535) "

 

The sys_script referenced is the one where I create the relationship. (line 38 is the call to the IRE)

 

Does anyone knows :

1- why my BR is triggered twice even if it should run only on CI creation (parent and child already exist in the CMDB)?

2- how to avoid this recursion? If I create the CI manually, I don't have this recursion issue.

 

thank you for your help

 

0 REPLIES 0