Re-starting a workflow

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');
}

Comments

Popular posts from this blog

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy

GlideRecord setValue