Difference between async and Query BR?

h_29
Tera Contributor

I am hoping to get some help to understand what is difference between async and Query Business rule with proper example. I have gone through docs but unable to get clear idea.

Regards,

Sam

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Sam,

 

Async business rules are similar to after rules in that they run after the database commits a change. Unlike after rules, async rules run in the background simultaneously with other processes.

'After' examples:

  • On a child task, update field on parent record and redirect to parent
    • The user will be redirected to the parent, so you want the business rule to be executing before returning control to the user
  • If a field changes from X to Y, do something
    • async rules cannot do previous condition checks, so use after

 

Async example:

  • When a parent is closed, close all children
    • This operation could take a while, it is best to return control to the user immediately and work in the background

 

Query Business rule:

  • Retrieve limited records from database & then display
    • Display Tickets (Incidents, Requests) where logged in user is Assigned To, Member of Assignment Group, Created by, Opened by, etc. So, if the system has thousands of records the record when User tries to access would be only thost that meet the condition above.
    • There exists OOB Query Business rule on incidents named incident query that restricts the visibility of incident with certain conditions.
    • ACLs can also be used for this but benefit of using Query Business rule would be the 'Security contraint message ..' that comes up because of ACL will not be shown.

 

View solution in original post

4 REPLIES 4

Dhruv Gupta1
Kilo Sage
Kilo Sage
Async VIdeo Link:https://www.youtube.com/watch?v=GFifmoxuR1U

Query BR Video link: https://www.youtube.com/watch?v=QLJEV_7ZYOk

Check this video tutorial. Explained very well. To cut story short query BR run before any database query for instance if I want to make user see CI's of their location. And async runs in background without consuming resources in the foreground.

RaghavSh
Kilo Patron

Async Business rule: Async business rule is same as after business rule and should be used when there is no urgency to update the records immediately and control should returns to the user.

Example: Close all child tickets when parent ticket is closed. As there is no urgency to close child tickets immediately Async business rule can be used so that control returns to the users.

 

Query BR: It always run on "before" database operation which restricts the user to access certain records.

Example: "incident query" BR on incident table is the perfect example which allow only ITIL users to access the incidents or if the incident is opened by or requested for the current logged in user.

Pls. mark this correct/helpful, if applicable.


Raghav
MVP 2023

Jaspal Singh
Mega Patron
Mega Patron

Hi Sam,

 

Async business rules are similar to after rules in that they run after the database commits a change. Unlike after rules, async rules run in the background simultaneously with other processes.

'After' examples:

  • On a child task, update field on parent record and redirect to parent
    • The user will be redirected to the parent, so you want the business rule to be executing before returning control to the user
  • If a field changes from X to Y, do something
    • async rules cannot do previous condition checks, so use after

 

Async example:

  • When a parent is closed, close all children
    • This operation could take a while, it is best to return control to the user immediately and work in the background

 

Query Business rule:

  • Retrieve limited records from database & then display
    • Display Tickets (Incidents, Requests) where logged in user is Assigned To, Member of Assignment Group, Created by, Opened by, etc. So, if the system has thousands of records the record when User tries to access would be only thost that meet the condition above.
    • There exists OOB Query Business rule on incidents named incident query that restricts the visibility of incident with certain conditions.
    • ACLs can also be used for this but benefit of using Query Business rule would be the 'Security contraint message ..' that comes up because of ACL will not be shown.

 

Pranav Bhagat
Kilo Sage

Async Business rule: Async business rule is same as after business rule but they work on a different thread.eg if you want to make a  rest call.

Query BR: It always run on "before" database operation which restricts the user to access certain records.

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Pranav