AnsweredAssumed Answered

How to start an avm workflow using custom code

Question asked by jipps on Nov 25, 2009

We are building a custom-ui for wcm workflow. But we are facing some issues in invoking the workflow.

We tried to invoke it using java backed webscript as well as webscript.

This is the script that we have written.

script: {
  var storeid = "myproj–admin";
  var fullpath = "/www/avm_webapps/ROOT/Newsletter/testnn.xml";
  var node = avm.lookupNode(storeid + ":" + fullpath);
  if(node != null){
       var workflowType = "jbpm$wf:review";
       var workflow = actions.create("start-avm-workflow");
       workflow.parameters["workflow-name"] = workflowType;
       var futureDate = new Date();
       futureDate.setDate(futureDate.getDate() + 7);
       workflow.parameters["bpm:workflowDueDate"] = futureDate;
       workflow.parameters["bpm:assignee"] = people.getPerson("marketinguser");
  model.node = node;

But we are not getting the resource attached with the workflow and it is not getting assigned to the "marketinguser" :(

Any body could please tell me what I am doing wrong?. How I can attach a content to a workfflow?

I am using Alfresco-Community-3.2 version.

Thanks in advance.