Restarting workflow not working properly

Shivam Saxena1
Mega Expert

Hello,

 

I am facing very weird issue while restarting the workflow.

I am restarting the workflow when the change state moves to Draft by clicking on Re-Draft button. So using UI Action I am just setting the values like change state, clearing start/end date etc. and for starting the workflow I am using after business rule. Please refer below screenshots.

 

find_real_file.png

 

find_real_file.png

 

I am writing the business rule in scoped application that's why used global prefix.

 

I am getting below issues :

1. Sometimes workflow working fine after restarting.

2. Sometimes workflow getting stuck in begin after restarting.

3. Sometimes workflow gets completed with all activity as restarted but only set fields and end activity as finished then workflow will not start.

 

find_real_file.png

 

Please help me in identifying where I am going wrong?

 

Thanks.

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

I have restarted workflows in a simple Fix Script for a few RITMS, and we always add an update line after the restart so that the workflow doesn't get stuck.  It's similar to the Nudge button when viewing the workflow context.  I'm not sure if you can do this all in one line, so I'll show you the syntax that has worked for us.

var wflow = new global.Workflow();
wflow.restartWorkflow(current);
wflow.runFlows(current, "update"); //the update is just going to nudge the workflow

If something is still amiss sometimes, what does it look like if you Show Workflow from the RITM to see the active or completed context?  Are any activities blue/completed or green/running?

 

 

View solution in original post

8 REPLIES 8

Hi Brad,

 

There were 3 group approvals before the workflow gets restarted and end right away. So, there was approval pending from one of the groups.

 

I was surprised after analyzing the functionality as sometimes it is working as expected but sometimes it fails like this above failure result.

 

Thanks.

Are you able to re-create this test case?  Maybe ALL requests pending approval from one of the groups will behave this way?  Is your Wait for field on the Approval Coordinator "All child activities to be approved"?  Are more approval records generated after the restart?  If not then approved and/or requested approvals should result in the requested state by the business rule.  It sounds like it's hitting the Approval Coordinator then the wait for condition is satisfied when it should not be.

Hi Brad,

 

This issue has been resolved. I have added 'wait for condition' activity at last which resolved the issue. Thanks for your time.

 

 

Thanks.

You are welcome, glad to hear you got that last case working.