AnsweredAssumed Answered

Changing the initiator of the workflow

Question asked by nehagupta on Feb 3, 2016
Latest reply on Feb 3, 2016 by niketapatel
Hi,

I have a requirement to change the initiator of the workflow. The workflow is started by executing a rule which in turn calls the below javascript code :



function main()
{
   var name = document.name;
   var workflow = actions.create("start-workflow");
   workflow.parameters.workflowName = "activiti$activitiReview";
   workflow.parameters["bpm:workflowPackage"] = document;
   workflow.parameters["bpm:workflowDescription"] = "Please review " + document.name ;
   var assignee = people.getPerson("admin");
   workflow.parameters["bpm:assignee"] = assignee;
   workflow.execute(document);
  
}

main();



I want to set the initiator of the workflow to some other user and wants this user to be able to view history of the workflow. The original initiator should not be able to view history of workflow.
I tried below code to change the initiator :


workflow.parameters["initiator"] = people.getPerson("someone");


This doesnot change the initiator. I found this link http://stackoverflow.com/questions/25372893/reassigning-initiator-in-alfresco-activiti-workflow
which talks about changing the initiator. But it is not very clear. Can someone suggest a solution for the same. I am trying this on Alfresco Community 5.0.d .

Regards,
Neha

Outcomes