Run a business rule after a transform map completes

Dan Hinrichs
Kilo Guru

Hello- we have a scheduled job that pulls in user data on a daily basis.   We also have a business rule that's triggered via the scheduler later in the day that fills in additional detail on user records.   I've been asked to shorten the gap between the time the user pull completes and the business rule runs.   Unfortunately, there's no trigger type of "After Parent Runs" on the scheduled job to simply connect this job to the user pull.

I am using a transform map to transform the user data into the sys_user table; seems like an onComplete script has some potential to connect these two items together.

My question: is it possible to call a business rule from within an onComplete transform script?   If not, would be best course of action be to copy the script used by the business rule into an onComplete script and then turn off the scheduled job so the business rule doesn't effectively run twice?

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Dan,



I'm assuming the business rule is defined on the sys_user table. If yes then all the business rule should be triggered once the data is imported in the target table. Please correct me if I'm missing something here.


Hi Pradeep- the business rule is running on the sys_user table, but it's only running via the scheduler (the insert, update, delete and query checkboxes are all cleared).  


Hello Dan,



Can you check if the "Run business rule" checkbox is set to true in the transformation map? If the value is set to no then you can put your logic in the "execute post import script" as mentioned by Jamie.


Jamsta1912
Tera Guru

Hello Dan,



If I'm understanding correctly, you have a scheduled data import, and you want to run a scrtpt after the entire import has finished. Is that right?


If so, you can check the 'Excecute post-import script' field on the scheduled data import record, and then put your 'business rule' in there.



Regards


Jamie