Dot walk /Scripts not working in 'Wait for condition' in WF

Arindam Ghosh
Mega Guru

In a Work Flow, I need to wait till one specific value is set for a field of a reference field of the table where I am writing a WF.

I tried to dot walk, Its not working. Even script is not Working. What is the best solution?

1 ACCEPTED SOLUTION

The easiest approach would be to update the record and have your workflow listen for that update.   An alternative would to to use the Wait for WF Event activity, then in your table B have a run script "fire/broadcast" event script to send an event to your table A workflow.


Workflow event-specific functions


View solution in original post

5 REPLIES 5

ccajohnson
Kilo Sage

Typically whenever you are using a Wait condition in a workflow, the workflow will not re-check the Wait until the current record is updated. Please elaborate how your wait condition is built so we can determine how to "touch" the current record and re-check.


Michael Ritchie
ServiceNow Employee
ServiceNow Employee

Workflows run against a specific record and table.   It wakes up on each update to that record or a broadcast from a script.   From the sound of it you are needing it to wait for a related record to be updated.   Unfortunately the wait for condition won't work unless you broadcast an update when that that child record is also updated.   You can look at an out of the box business rule called "SNC - Run parent workflows" as an example.   Basically this business rule runs when a task is closed and the parent attribute it set where it will broadcast an "update" event to its parent.


Arindam Ghosh
Mega Guru

Thank you Chris & Mike for Reply.



Here is my requirement:


I have table_a and have a workflow_a runs on table_a. Also I have a reference field, (in table_a) which refers to table_b also another workflow_b runs on table_b. Both the WF are totally separate.



Now execution of workflow_a starts before execution of workflow_b. and in a point execution of workflow needs to be paused till workflow_b is approved.



So to achieve this, I am trying to write a business rule on sysapprover_approval table. This Rule will trigger only if the approval is related to the table_b and if the state changes to approved or rejected and based on that will update the workflow_a as approved or rejected. and in wait for condition will mention this condition: if approved or rejected then start execution again.



Is it a right approach?


I would have a run-script Workflow Action after the approval and rejection which will update the record on table A. Does Table A have a journal field like Work notes? If it does (or if it was extended off of Task) you can just update that field. Please provide the script you were intending on using on the Approval table. We could use that as a baseline for the Run-Script Workflow Action.