Query on "REST API and business rule running order"

BT10
Tera Expert

Hi Expert ,

Just wanted to know in following scenario - 

 

we have scripted API which insert data in "A", "B" , "C" tables.  it means all business rule which are running on  "A", "B" , "C" tables they will also run.

but scripted api need to wait for all business rule to complete before sending response back??

 

 

for ex. 

1.all business rules on table A take 1 mins to complete.

1.all business rules on table B take 2 mins to complete.

1.all business rules on table A take 3 mins to complete.

 

does it mean that scripted API need to wait minimum 6 mins before sending the response 

OR 

API will process normally and all business rule will get trigger but REST api will not wait for all to complete ??

 

8 REPLIES 8

Hi,

I haven't searched it but you can try to search in docs or some blog

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

suvro
Mega Sage
Mega Sage

Hi,

 

What is the point in waiting. Are we getting some values from the Business Rules that we need to send in response. If not you can send a status like 102 --> stands for processing or 200 or 202, whatever makes sense. You can go through below link for various response status so that it is very informative

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

 

 

My REST API is taking time in processing and i am trying to troubleshoot the flow.  If business rule is taking time in processing then i need to disable business rule.

Hi,

 

Try using gr.setWorkflow(false);  just before you are doing any update or insert and Check whether it reduces any time. It will help