- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 07:50 AM
Hello ServiceNow Gurus,
I am facing a challenge pertaining to workflows more specifically the "Wait for Condition" utility.
In this case, the workflow needs to wait until the underlying PtO(Permit to Operate) record has been approved. I have created a "Ptb Approval Flag(u_pto_approved)" True or False field on the underlying table, that checks if the associated PtB record is approved or not. If the associated PtB record is approved a BR is triggered to update the Approval Flag field to True.
My intention of using "Wait for Condition" is to wait until once the flag has been checked, and then proceed forward with the workflow. As it stands, the once the PtB record is approved, the Approval flag updates to True but the workflow stops there and doesn't proceed forward. However, I did notice if I update any other random fields on the form, and hit save, the workflow then only proceeds forward.
Is there a way I can automate this? Such that once the PtB Approval Flag is checked by the BR, the workflow proceeds forward without any hinderance? Would I need to add in additional script to my BR such that once Approval Flag is true -> trigger back the workflow? If so, how would that additional piece of script look like?
Much thanks for your insight on this matter.
-Dominic
Solved! Go to Solution.
- Labels:
-
Enterprise Release Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 10:10 AM
Ohh, are you setting the PtB Approval flag from a display business rule?
That makes sense, as the value is just shown on the form and not really saved at the server side. In fact, since the server side value is still "false" for this field, even if we trigger the workflow from display business rule, it won't work.
What I'd suggest is to write a business rule on PtB Approval records. And as soon as it is approved, update the parent rm_release record. That would trigger the workflow.
-Mandar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 08:06 AM
The PtO table is an extension of task, correct?
Go to the business rule table and look for "SNC - Run parent workflows". What this is supposed to do is "tickle" the existing workflows for a Task and re-evaluate things like wait for conditions and updates. Its also the mechanism that helps a workflow decide "oh, that Task was closed, therefore proceed to the next task".
I seem to remember a couple of versions where you needed to manually build a similar rule on for whatever extension of task you were running workflows on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 08:08 AM
Another thing you can check (but this is a long shot) is if the business rule that populates the u_pto_approved field doesn't have a line that says "setWorkflow(false)"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 08:17 AM
Hi Robert,
Thanks for your speedy response. To answer your questions: PtO is extended from the task table. And there isn't a line that says "setWorkflow(false)" on the BR that populates the PtB Approval flag.
I have also found the BR -> "SNC - Run parent workflows" defined to the task table and is active. What am I supposed to do this BR? Copy it over somewhere else?
Much thanks for your insight
-Dominic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 08:25 AM
Its worth a shot (on dev or sandbox). I know the Task rule *SHOULD* work, but there was a couple versions I worked on where I had to copy the script and conditions to another business rule on my extended table.
I really hesitate to give that advice because, again, the Task table version should be doing that grunt work for you.