AnsweredAssumed Answered

Workflow completes immediately

Question asked by sgartner on Mar 3, 2010
Latest reply on Mar 17, 2010 by sgartner
Hello all,

I have an advanced workflow and I am trying to launch it from JavaScript.  Here is the code I'm using to start the workflow:

var nodeId = args.nodeid;
var document = search.findNode("workspace://SpacesStore/" + nodeId);
var workflowAction = actions.create("start-workflow");
workflowAction.parameters.workflowName = "jbpm$nmwf:MyWorkflow";
workflowAction.parameters["bpm:workflowDescription"] = "Please edit: " +;
workflowAction.parameters["bpm:assignees"] = [people.getPerson("admin"), people.getPerson("andyg")];
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflowAction.parameters["bpm:workflowDueDate"] = futureDate;

This runs fine and e-mail sent from the start node's default transition fires just fine.  However, when I go looking for the workflow in my task list it is not there, but it is in my *completed* task list.  The default transition (the only transition) from the start node points at a task node which has four transitions.  Can anyone help me to understand why it would immediately complete?

Note that if I test MyWorkFlow in the workflow console it does show up in my task list.  I'm very confused.

Thanks in advance,