AnsweredAssumed Answered

JavaSript started workflow - Cant get bpm_workflowDueDate

Question asked by matjazmuhic on Dec 13, 2010
I start new workflow in from another workflow node like this:

var documents = bpm_package.children;
var i;
var invoice;

for(i=0; i<documents.length; i++)
      invoice = documents[i];

var configNodeRef =["aginv:ChosenConfigNodeRef"];
var config = search.findNode(configNodeRef);
var lqAssignee = config.assocs["agfo:wfConfLiquidationAssignee"][0];

var wfName = "jbpm$agfo:liquidationWorkflow";
var workflow = actions.create("start-workflow");
var bpmDueDate = new String(bpm_workflowDueDate);
var dueDateArray = bpmDueDate.split(" ");
var dueDateString = new String(dueDateArray[0])+" "+new String(dueDateArray[1])+" "+new String(dueDateArray[2])+" "+new String(dueDateArray[5])+" "+new String(dueDateArray[3]);
dueDateString = dueDateString.replace(/undefined/g, "");
dueDateString = dueDateString.replace(/-/g, "/");
dueDateString = dueDateString.replace(/\s+$/,"");
dueDateString = dueDateString.substring(0, dueDateString.length-2);
workflow.parameters["bpm:workflowDueDate"]=new Date(dueDateString);
workflow.parameters["bpm:workflowDescription"] = wfName + " started by toLiquidation script";
workflow.parameters["bpm:comment"] = "Started by toLiquidation script…";

Now I try to set taskInstance dueDate to workflow dueDate inside a workflow (beanshell script) like this:

if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;

If I try to print the bpm_workflowDueDate with System.out.println it says its void. But in the same node if I access the bpm_workflowDueDate in javascript It shows the dueDate correctly.

Any Ideas?