Slow business rule in logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 02:31 PM
Hi SNC,
I have an issue with a business rule. The business rule is set to fire when a change is assigned to a specific assignment group and the state changes to Closed. When the conditions are matched, the business rule sends a rest outbound message to a Slack channel (part of a ServiceNow-Slack integration). Unfortunately the message in Slack is not received, meaning that the business rule did not fire properly.
When I reviewed the logs, I found one which was saying 'Slow business rule' and was for that business rule.
I am not sure how to read that - was the business rule too slow and never executed, or what?
I know the code for the business rule is OK, as it worked on my non-prod instances. So there is something else which is making the execution of the BR slow. Any ideas???
Here is the start of the log:
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 02:40 PM
Hello Dimitar
How does the outbound REST call behave outside of BR. Have you given a try to "Test" that outbound REST message?
This is just to pin point if the problem is with the BR or with the integrating partner.
~@$#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 02:45 PM
Yes I have tried it. I have another BR, which does the same exact thing (posts a Slack update) on change start (different conditions) ,and it works perfectly.
My suspicion is that something is making the BR execute too long and it times out but I am not sure what that is?...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 02:50 PM
Hi Dimitar,
If they are the same logs, you can confirm it by session id. Yes business rule was executed, even though if its showing slow but if you look at the end it shows you time was and its just 312 ms. So business rule was not actually slow, but something in the script of the business that didnt sent the outbound message.Review you script.
-- Have some debug statements in the business rule gs.log, this will make it easy to debug. You can check the debug logs in system logs.
-- Other thing you can do is enable debugging for business rules (System Diagnostics > Debug Business Rule)
http://wiki.servicenow.com/index.php?title=Debugging_Tools_Best_Practices#Debug_Business_Rule
Hope this helps, if you need more help paste your business rule.
Shruti