AnsweredAssumed Answered

Workflow API, JavaScript, Web Scripts

Question asked by snig on Sep 10, 2007
Latest reply on Sep 17, 2007 by davidc
Hi

I am trying to initiate a workflow by Workflow JavaScript API, it is called in a Web Script.

Here is the code snippet… It is pretty much exactly same as the examples provided in various Alfresco Wiki pages…

   var workflow = actions.create("start-workflow");
   workflow.parameters.workflowName = "jbpm$wf:job";
   workflow.parameters["bpm:workflowDescription"] = desc;
   workflow.parameters["bpm:context"] = objectSpace;
   //workflow.parameters["bpm:assignee"] = person;
   var futureDate = new Date();
   futureDate.setDate(futureDate.getDate() + 7);
   workflow.parameters["bpm:workflowDueDate"] = futureDate;
   workflow.execute(objectSpace);

It fails saying "Internal Server Error".

However, I tried to debug it by the JavaScript Debugger. It throws a NullPointerException at line
   workflow.execute(objectSpace);

Not sure what is the issue.

Is there any documentation what exactly workflow.execute does? And what should be the parameter passed into this?

Thanks,
Snig.

Outcomes