What I Learned During Pair Programming This Week
Pair Programming Reaps Tremendous Benefits

What I Learned During Pair Programming This Week

For #ServiceNow fans — I learned the real benefit of using an ASYNC business rule. 

Here was my problem: I had an after business rule that relied on values set by a UI Action to implement some business logic on a record in another table. When the after business rule ran, it was returning null values even though the UI Action was setting values before doing a current.update(). 

This was causing problems in the after business rule’s logic that relied on certain values in those fields being set by the UI Action. Thanks to @John Bowker and @Joseph Mertens for helping me better understand how the ASYNC business rule works. By changing that business rule from an after business rule to an ASYNC business rule, the field values became available; therefore, allowing the proper business logic to be implemented. 

Here’s the ServiceNow documentation on ASYNC business rules. “When the scheduler runs the scheduled job created from the business rule. The system creates a scheduled job from the business rule after the user submits the form and after any action is taken on the record in the database.” [emphasis added]

https://docs.servicenow.com/bundle/orlando-application-development/page/script/business-rules/reference/r_HowBusinessRulesWork.html

So in my situation, the after business rule was, for some reason, apparently not running at the right time to be able to see the UI Action’s field updates. By changing to an ASYNC business rule, the scheduled job that the async business rule created actually waited until after the database record was updated to run, thus giving my business rule a chance to see those UI Action-updated values. It would seem like the after business rule should only run AFTER the record was updated by the UI Action's current.update(), but that after business rule apparently ran before the record was updated.

So I learned that it's better to involve all members of a SCRUM team and that getting them involved early reaps tremendous benefits. Pair programming is awesome sauce - give it a try!

--

Aarti Smith

President & CEO of Chainbridge Solutions Inc.

4 年

Proud of you Rick Forristall John Bowker Joseph Mertens!!! Practicing collaboration, self organizing, and team work!!! Keep it up!

Michael Sypes

PHP/MySQL/Drupal web developer ready for a management role

4 年

I love pair programming!

要查看或添加评论,请登录

Rick Forristall的更多文章

社区洞察

其他会员也浏览了