Notifications

262 views

Symptoms


Workflow Wait Condition met - yet workflow is not moving forward

Release


Applies to all Release

Cause


The "wait for condition" workflow activity is not suitable for the above mentioned scenario. 

Resolution


In the "wait for condition" workflow activity, what we are trying to achieve is to wait for the Date value in a variable to be less than or equal to today's date. So basically we are asking the activity to wait till the date specified in the variable. 

So to achieve this functionality, the "wait for condition" workflow activity is not suitable for us. The reason is that the workflow engine will check for the condition in the "wait for workflow" activity only when the RITM record is updated. 

So this is the reason for the RITM, the condition in the "wait for condition" activity was not be evaluated as there were no updates for the RITM (for several days past the due date mentioned in the variable). So whenever the RITM was updated (after several days), the condition will be evaluated and it would be satisfied and it would move to the next activity. 

Therefore instead of the "wait for condition" activity, we can use "Timer" workflow activity. 

In the "timer" workflow activity, please select the "Timer based on" information to "Script". 

Then we can calculate the "number of seconds" the timer has to wait based on the difference between the date the RITM record was created and the date specified in the variable "Date to Disable System Access". 
Please note that in the script section, we should specify the number of seconds that the timer has to wait in the variable "answer" and duration should always be in "seconds". 

Please refer to this documentation for how to calculate the "number of seconds" using a script: 
https://docs.servicenow.com/bundle/kingston-application-development/page/script/server-scripting/concept/c_DrtnClDueDate.html 

Please refer to this documentation for more information on "Timer" activity: 
https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/administer/workflow-activities/reference/r_Timer.html 

Please refer to this documentation for more information on "Wait for condition" activity: 
https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/administer/workflow-activities/reference/r_WaitForCondition.html 

 

Article Information

Last Updated:2018-08-14 07:42:10
Published:2018-08-14