Workflow is getting cancelled at the End Activity

Kusuma2
Kilo Guru

Hi,

I have designed the workflow in which catalog tasks should generate parallel.

And I have added the wait for condition to check all the catalog Tasks are completed or not.

But My problem is The Workflow is getting cancelled at the End. Any Reasons.?

In the properties I have changed the maximum count activity to 200.But no luck.

 

5 REPLIES 5

palmen
Tera Guru

Can you share your workflow, it's hard to tell when we can't see how you build the workflow.

Is the workflow canceled or finished?

The maximum count activity shouldn't matter in this case unless you have a loop going through the same actions over and over again or if you have a very large workflow.

You could use a wait for condition and make a script checking all tasks are closed before it goes on to the next stage.
This is an example we use (should probably use GlideAggregate instead of getRowCount for optimal performance).

//Set the variable 'answer' to true or false to indicate if the condition has been met or not.
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.getUniqueValue());
gr.addActiveQuery();
gr.query();
var count = gr.getRowCount();
if(count > 0)
	answer = false;
else
	answer = true;

find_real_file.png

tanajipatil
Tera Contributor
A guess is your workflow is going into multiple execution paths as you are not using branch and join for parallel tasks. You can verify this by checking workflow context. Instead of using wait for conditions use branch activity (before tasks) and join activity (after tasks). And make sure all the task activities have wait for complete checked. This will not allow your workflow to go into multiple execution paths.

Good Solution Tanaji, Sometimes, wait for condition fails and Branch/Join works. Thanks for this.

Kusuma2
Kilo Guru

Thank you.. I used the join activity after the catalog Task and it is working good.