var gr = new GlideRecord('wf_context');
gr.addQuery("id", current.sys_id);
gr.addInactiveQuery();
gr.addQuery("name","<workflow name>");
gr.query();
if (gr.next()){
gs.addInfoMessage('restarting "<workflow name>" workflow');
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('<workflow name>'), current, 'update');
}
gr.addQuery("id", current.sys_id);
gr.addInactiveQuery();
gr.addQuery("name","<workflow name>");
gr.query();
if (gr.next()){
gs.addInfoMessage('restarting "<workflow name>" workflow');
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('<workflow name>'), current, 'update');
}
Comments
Post a Comment