- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2016 12:37 PM
Workflow is stuck at begin after restart of its workflow.
Here when "flag to yes " activity is reached i am restarting it via BR
BR is as follows:
createtask();
function createtask() {
gs.addInfoMessage("restarting workflow");
current.u_response = '';
new Workflow().restartWorkflow(current);
}
what might be the issue here ??why is it gettin gstuck at begin even though when validated shows no signs of warnings/errors
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 01:44 AM
Hi Dhruva,
Have you attempted to do an update to the source record where the workflow is running?
The workflow does not seem to continue as although the workflow has restarted, there is no update to the record in order for the workflow to progress.
Once you update the source record, e.g. Change Request, Requested Item, etc, then the workflow should proceed as expected.
You will need to modify the logic to allow the source record to be updated, so that the workflow can move forward
Please note: I would NOT recommend using any "current.update()" script in the business rule to force the workflow to move forward as this will cause a performance impact
Reference: Business Rules Best Practices - ServiceNow Wiki
Please let me know if you have any further questions.
Best Regards,
Arron

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2016 06:58 PM
Hi Dhruva,
Try moving the message and restartWorkflow() to an after business rule. You want to impact related records after the changes have been saved to the database.
your current.u_response = ''; is in the right place (if this is in fact a BEFORE business rule.)
Business Rules Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2016 08:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2016 08:52 PM
if you can see in image it is a already an after business rule , even then it is stuck, any solution for this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 01:44 AM
Hi Dhruva,
Have you attempted to do an update to the source record where the workflow is running?
The workflow does not seem to continue as although the workflow has restarted, there is no update to the record in order for the workflow to progress.
Once you update the source record, e.g. Change Request, Requested Item, etc, then the workflow should proceed as expected.
You will need to modify the logic to allow the source record to be updated, so that the workflow can move forward
Please note: I would NOT recommend using any "current.update()" script in the business rule to force the workflow to move forward as this will cause a performance impact
Reference: Business Rules Best Practices - ServiceNow Wiki
Please let me know if you have any further questions.
Best Regards,
Arron