- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 05:07 AM
We have a workflow running which has a timer event on to wait for all the catalog tasks to be closed before it continues to the next stage.
The problem we have is that the workflow activity count exceeds 100 when its waiting for a while of the tasks to be closed, and the workflows are automatically cancelled, leaving the RITM in limbo.
I've tried to find out where the max count of 100 is found to see if I can change it, but, I don't seem to be able to find it anywhere.
Can anyone help? or if anyone has any ideas of how to get around this please let me know. We don't want to raise the timer anymore than it is (every 2 hours).
Hoping someone can help!
Regards
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 06:24 AM
If you want to change for existing workflow, Go to workflow editor > Checkout your workflow > Go to Properties > There you can change the count.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 02:11 AM
Jason
I'm just looking at using the wait for condition. I don;t see how I can use it? The workflow is attached to the requested item. As part of the workflow, it sets up numerous catalog tasks.
When it gets to the timer, the timer basically waits 2 hours, then an ID statement checks to see if any catalog tasks are still open,if there are, it then goes back to the timer to wait 2 hours before it checks again:
var tasks = new GlideRecord('sc_task');
tasks.addQuery('request_item' ,current.sys_id);
tasks.addActiveQuery();
tasks.query();
if (tasks.next()) {
answer = 'no';
} else {
answer = 'yes';
}
I can't see how the wait for condition would work? I can add a script into there, but wouldnt this then fire at the first time one of the catalog tasks is closed? Do you have any ideas?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 02:20 AM
Hi Pennie,
In the 'Wait for condition' activity you have a field named 'condition script'.
Here you can write your code to check for any active tasks and then set answer to true/false.
Use below code in you wait for condition activity -
var tasks = new GlideRecord('sc_task');
tasks.addQuery('request_item' ,current.sys_id);
tasks.addActiveQuery();
tasks.query();
if (tasks.next()) {
answer = false;
} else {
answer = true;
}
This will make your workflow to wait until all the tasks are closed or become inactive and only then move ahead.
Thanks,
Tanaji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 02:54 AM
Hi
I have tried this, but it doesnt work. I think its because its a script, there's nothing to say re-run the script to check the tasks are closed, so the workflow is just hanging at the wait for condition.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 02:59 AM
No it will keep checking/running your script until it passes it. There is no need of manually doing it.
Make sure you are setting true/false to the global answer variable and not 'no'/'yes'.
Can you just copy paste above code and re-try?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 03:06 AM