03-23-2017 09:42 AM
I need to cancel workflow programmatically when folder is updated, I can use the rule to call script, but I have no idea how to write script, that will stop workflow that was started for this folder.
Can somebody help me with it?
03-28-2017 08:45 AM
This is how I can do it
for each ( wf in document.activeWorkflows )
{
workflow.getInstance(wf.id).remove();
}
03-23-2017 09:46 AM
If it is important, this is my script to start workflow
var date = new Date(new Date().getTime());
date.setMinutes(date.getMinutes()+20);
var workflow = actions.create('start-workflow');
workflow.parameters['bpm:workflowDueDate'] =date;
workflow.parameters.workflowName = 'activiti$validationProcess';
workflow.parameters['bpm:workflowDescription'] =date.getHours()+":"+date.getMinutes()+". Check "+document.name;
workflow.parameters['bpm:assignee']=people.getPerson("admin");
workflow.parameters['sendEMailNotifications'] = false;
workflow.execute(document);
03-28-2017 08:45 AM
This is how I can do it
for each ( wf in document.activeWorkflows )
{
workflow.getInstance(wf.id).remove();
}
Explore our Alfresco products with the links below. Use labels to filter content by product module.