AnsweredAssumed Answered

Task assignee variable

Question asked by beber7 on Jun 24, 2016
Latest reply on Jun 29, 2016 by jbarrez
Hello guys,

I'm writting you after spending a day looking for answer all over the web for something that might be really simple to you.

I've created a workflow in Activit Explorer ( similar to a adhoc wf than I will make more complex later on ).
In this worflow, I just want to assign a task to a user ( yes that's it ) and deploy it to alfresco.

Start -> user task -> end

Base on what I've seen so far, I wanted to use the following argument on the task assignee parameter : ${bpm_assignee.properties.userName}

I figured the activiti engine does not know about bpm and get an error " Unknow property used … " when I drop a file in a specific folder.

Note : I use Javascript code, that is trigger by a rule "On document created or move into folder" to instanciate the workflow.

Here is the code, very simple :


function createAdvancedWorkflow() {
   var workflow = actions.create("start-workflow");
   workflow.parameters.workflowName = "activiti$workflowbased";
   workflow.parameters["bpm:workflowDescription"] = "The attached document has been uploaded to Alfresco. Please review within 3 days.";
   workflow.parameters["bpm:assignee"] = "admin"; // TODO: not hard coded, this is testing

   var futureDate = new Date();
   futureDate.setDate(futureDate.getDate() + 3);
   workflow.parameters["bpm:workflowDueDate"] = futureDate;
   return workflow.execute(document);
}

function main() {
       logger.warn("Test warn OK");
       createAdvancedWorkflow();
}

So the question is :
- In activity explorer when editing my task what variable can I use to be able to assign a user to the task from the JS code ?
( What should I use instead of ${bpm_assignee.properties.userName} to make this work :  workflow.parameters["bpm:assignee"] = "admin; )

If anyone can be the light in my shadow it would be much appreciated.
Thank you for your time :)


Outcomes