AnsweredAssumed Answered

Starting an advanced workflow with Javascript

Question asked by nparry on May 23, 2007
Latest reply on May 23, 2007 by davidc
Hi,

I've built a simple workflow and deployed it successfully with the jBPM GPD.  I'm trying to start it with a javascript, but I think I'm not seeing the connection between some of the variables.

This is the only code I could find on the topic.  If you have any other examples to point to, that would be great.


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

My main question is where do the parameters from the bpm namespace come from, and how do I get make another namespace with my own parameters?

Also, as per the wiki, I replaced the line

workflow.parameters["bpm:assignee"] = person;

with the line

workflow.parameters["bpm:assignee"] = getPerson("username");

I got this error: ReferenceError: "getPerson" is not defined.
Why doesn't the engine recognize this function?

Thanks,
nparry

Outcomes