re-start a workflow

var gr = new GlideRecord('wf_context');
gr.addQuery("id", current.sys_id);
gr.addInactiveQuery();
gr.addQuery("name","HR case placed on hold");
gr.query();
//while (gr.next()){
if (gr.next()){
/*gs.addInfoMessage(gr.active);
if (gr.active && current.state!=previous.state){
//--cancel the old workflow
gs.addInfoMessage('cancelling previous on hold workflow');
var wf = new Workflow();
wf.cancel(gr);
}*/
gs.addInfoMessage('restarting "HR case placed on hold" workflow');
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('HR case placed on hold'), current, 'update');
//break;
}

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