logo

NJP

Async Business Rule [ServiceNow]

Import · Jul 15, 2019 · video

hello everyone so in this video we are going to learn and discuss about a single business rule a single business rule executes after record are inserted updated queried a synchronous rule run asynchronously as scheduled a single business rule are queued up while scheduler to run as soon as they can be fit in this business rule don't have access to previous version off record basically devious object is not available in a synchronous tool you can see a synchronous rule queued up for execution as below you can go to system scheduler then schedule job and under that is scheduled job so let's just go to system system is scheduler under that we have a scheduled your and that scheduled event is scheduled go so you will see the name prepended with asking for a synchronous tool so if you will type here yes my can see so like this you can see that English is route queued up for running so the examples are SLA calculation another Edwin could be notify CI owner of see I added admin configuration item to and incident so we will practice this so we have a note here try to use a synchronous rule instead of after business rule when immediate response is not required so you can follow this practice the problem statement here we have is notify CI owner if a CI is added as an configuration item to an incident so we have solution I will implement in step by step here you can practice it any other instant to learn it in a better way so we need to create a event and the event registry to trigger the notification and we need to design a notification and after that we will designer I think business rule so let's say go to event registry to create a event will go here we will the name of gran notify CI owner we will click on new we will put the name as notify CI owner able we can select at incident you can put fired by here for information fired why we can say business rule you can define our custom queue for processing the event I am going to use default one and I will save then we will design a notification let's go to notifications your notifications click on you put the name as noted by CI honor and we will select the table as incident so we're going to send you slackers event is fired then we will select the event here notify yes PA which one if one of you created notify CI owner when we will receive it so we will stand it to CI owner let's read the configuration here we have configuration item we will expand it and we will go to on right we are using the dot walking here as configuration item plate that reference below incident and so configuration item on why then what it will contain so we have the content here subject and body so I will just copy it put it and subject and I will copy the body and put it so you can design a notification with better content better looking field I am just designing for a testing purpose so that I can demonstrate this example I will save this next thing I need to create a single business tool I will go to business tool this is totally after I will create a new business rule notify affected say one of notify CI then we will select the table add incident we will check advanced select inserted or updated so CI can service desk is reading a ticket and they can select the CI before insertion so our business rule run so to run on insert and update both because later on the CI can be updated as well so we will select here a sink and then we have this quote throat I will just copy this code you can type it in your strength I will test it here so in this code I am just using the event queue so for triggering event through business rule or workflow or from any server-side script we have event queue function which we use so jail tour event queue then we are passing here as parameter as a name of the event which we registered then the current record object then basically we can pass the parameter from here as well the recipient basically we are sending in param one or we can select as we selected will receive that we can use and then GS dot get username so param1 param2 we need to pass so let's just do one thing let us remove the recipient from here and you the recipe act or event queue which we are passing through event queue so for that we will check here as event Perriman contain recipient so basically we are sending the recipient through event queue using the param 1 now let's just say this and now we will go to incident we will create a new incident let's just check the event queue first so we will put it here I will tutor then we will select CIE in IBM so makes your your CI has on Y populated here you can see on Y is populated on my CI so if this field is not available on Sky home you can configure the form layout and add it and then you can vote later on Y person on that CI to test it because if that on Y will be blamed the notification will not trigger so I will save this now let's just go to emails here we will check the log so here we have email opened on your BF so here we had the email triggered so basically asking business tool runs after after we missile but it want the user might not be able to observe the delay report delay is very less so here we have configuration item this is just to incident this so if you want to verify that you number under double 0 23 1.0 23 so always wear immediate response is not required we can make use of us in business rule so user might not be able to observe the difference because the time difference is very less so the delay might not be observed thank you for watching this video please like share & subscribe the channel I will be back with some other videos thank you

View original source

https://www.youtube.com/watch?v=GFifmoxuR1U