
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2017 05:35 AM
Hi,
Is it a best practice to use wait for condition activity for multiple days . I have a temporary server access provisioning orchestration with access start date and access end date. I can easily create a workflow with start date and end date condition using wait for condition activity. But I don't know it is a good practice? If it is not what is the impact in it.?? And how to avoid that?
Regards,
Vivek
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 02:08 AM
Hi Vivek,
You need to specify the number of seconds the workflow should wait in the answer variable. The script would go something like this
var curr_date = gs.nowDateTime(); // Used this method as it returns time in users timezone
var now = new GlideDateTime(curr_date);
var start_date = workflow.scratchpad.access_start_date;
var start= start_date + ' 00:00:00';
var eod = new GlideDateTime(start);
answer = (eod.getNumericValue() - now.getNumericValue()) / 1000;
Thanks
Thameem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2017 09:10 AM
Hi Vivek,
If your workflow should check the wait for condition only when the current record is updated then wait for condition is the option to go.
But if the use case is like it should check something like wait for some date then Timer activity should be the better option.
http://wiki.servicenow.com/index.php?title=Timer_Activities#gsc.tab=0
Thanks
Thameem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2017 01:17 PM
Hi Vivek,
It depends what condition you are waiting on and how long do you think it will take. You can use combination of If and timer activities or wait for condition activity.
Wait for condition activity only evaluates when current gets updated. But timer will keep on evaluating after every interval. As workflows are running on their own thread, there shouldn't be any problem in using these activities.
Thanks.
PS: Hit like, Helpful, Correct and Endorse, if it answers your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2017 11:51 PM
Thanks Nisha and Thameem for your response.
I have a date variable will use"wait for condition" to match with the current date. So if my wait for condition matched with current date but still my current record is not updated then my workflow won't go further activities?
Regards,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 12:08 AM
Yes Vivek,
Workflow evaluates wait for condition only when record is updated. If that is your requirement then Timer activity would be better.
Thanks
Thameem