cancel
Showing results for 
Search instead for 
Did you mean: 

Re:Dynamic initiation fo workflow

britto
Champ in-the-making
Champ in-the-making
Hai to all
       we are extending alfresco for our  project. In Existing Alfresco the admin user has to initiate the workflow by assigning to one of the user Called "A".
when "A" user logs in  he gets the task that  he  has to do.when he starts clicking on the task the workflow is being continued.
In our need ,

      we don't want to admin to initiate the workflow for  a user called "Buyer".
when "buyer" user  logs in,he should be automatically get the task that he  has to do.
In order to get the task for him.we need automatic initiation of task assigning to user "Buyer".
any help can be appreciated to do this.

Regards
britto
1 REPLY 1

adnangul
Champ in-the-making
Champ in-the-making
It's simple, following example show how you can do so

Here is how you you create workflow and set params

var workflowInst = actions.create("start-workflow");
workflowInst.parameters.workflowName = "jbpm$" + <workflowType>;
workflowInst.parameters["bpm:workflowDescription"] = description;

//assigning to person
workflowInst.parameters["bpm:assignee"] = people.getPerson("<user name>");

//after setting all desired params start workflow as
workflowInst .execute(node);

Hope this will resolve your problem,

Adnan