cancel
Showing results for 
Search instead for 
Did you mean: 

Start workflow from datalist

andy_db
Champ in-the-making
Champ in-the-making
Hallo everybody,

I have made a simple task list with an assignee, due date, priority and title in share.

Now I want to start a workflow with a script.

This is my script :
var person=document.assocs["dl:issueAssignedTo"][0]; // what does assocs in this rule?
var username=person.properties["{http://www.alfresco.org/model/content/1.0}userName"]; //( can someone explain me what this rule do? )
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "activiti$activitiAdhoc";
workflow.parameters["bpm:workflowDescription"] =  document.properties["dl:issueID"] + " - "+ document.properties.title;
workflow.parameters["bpm:assignee"] = people.getPerson(username);
workflow.parameters["bpm:workflowDueDate"] = document.properties["dl:issueDueDate"];
workflow.execute(document);

After my script was uploaded, I make a rule on a folder. When i upload a file, I execute this script.
But the problem is that my workflow don't start.
Can someone help me please?

Kind regars,
Andy
1 REPLY 1

mitpatoliya
Star Collaborator
Star Collaborator
Is your script getting executed?
If yes what is the error you are getting?
I think your person object is null make sure it is not null.