I want to add a workflow on all files in a folder automatically thanks to a content rule. I've seen that one workflow already exists (review group) but I want to add one that permits only to Site manager to valid the document (manager review). I've add a javascript script, this is my code that don't work :
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:parallelgroupreview";
workflow.parameters.requiredApprovePercent = 20;
workflow.parameters["bpm:workflowDescription"] = "Please review and approve: " + document.name;
workflow.parameters["bpm:assignee"] = site.listMembers(null, "manager", 0, true);
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.execute(document);
Please, can you help me because I'm a bit confused.
Thanks !