cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptableObject properties in startWorkflow

snig
Champ in-the-making
Champ in-the-making
Hi All

Need to start a workflow using the Workflow JavaScript API provided in 3.2 - http://wiki.alfresco.com/wiki/Workflow_JavaScript_API.

In the JscriptWorkflowDefinition object, we can start a workflow using the startWorkflow method. However, there we need to send a ScriptableObject argument as the workflow parameters to be started.

How, in alfresco js file we create this ScriptableObject variable?

Thanks
Snig.
2 REPLIES 2

snig
Champ in-the-making
Champ in-the-making
However, I cannot use the typical actions.create method of starting a workflow, since this does not return any value.
I need to get the instanceId of the newly started workflow.

snig
Champ in-the-making
Champ in-the-making
Resolved.

Sample Code:

var workflowParameters = new Array();
var futureDate = new Date();
futureDate.setDate(futureDate.getDate());

workflowParameters["bpm:workflowDescription"] = wdescription;
workflowParameters["bpm:workflowDueDate"] = futureDate;
workflowParameters["bpm:workflowPriority"] = 1;

var wpath = wdef.startWorkflow(userhome, workflowParameters);