- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday - last edited Thursday
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
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Hi Kumar,
Thank for the answer.
The recursion was from the same script. And I can not disable the workflow, thing must continue to be executed on CI creation.
It seems that the recursion was caused because even if the CI is already created and the BR execute after the creation. We're still in the transaction of the creation. As this transaction was initiated by the IRE, you can not call the IRE on the CI again.
I changed my BR to async with a priority and order of 200. It is now working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Hello @Amar_Be
The recursion could happen due to two reasons:
1. There could be another business rule running on the same table during the CI insert/Update.
2. Or the same business rule getting triggered when the IRE API creates new CI in the table.
Possible recommendation:
1. First Identify the recursive script from error logs or IRE logs
2.Use setWorkflow(false) to avoid triggering another business rule - This shouldn't the Out-of-the-box behaviour
If I could help you with my response, you can mark it as helpful and correct, as it benefits future viewers
Thanks,
Sai Kumar B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
Hi Kumar,
Thank for the answer.
The recursion was from the same script. And I can not disable the workflow, thing must continue to be executed on CI creation.
It seems that the recursion was caused because even if the CI is already created and the BR execute after the creation. We're still in the transaction of the creation. As this transaction was initiated by the IRE, you can not call the IRE on the CI again.
I changed my BR to async with a priority and order of 200. It is now working.