cancel
Showing results for 
Search instead for 
Did you mean: 

Read and update Properties in a workflow task

vmustafayev
Champ in-the-making
Champ in-the-making
Hi,
How we can read and write task properties in alfresco webscript js file?
I wrote code like this:

var taskId = "jbpm$12";
var task = workflow.getTask(taskId); //workflowTask
logger.log( task.getProperties() );

but it prints null Smiley Sad
I read about getProperties method in http://wiki.alfresco.com/wiki/Workflow_JavaScript_API

please  help me, how we can read and write properties in webscript JS ? Smiley Sad
1 REPLY 1

vmustafayev
Champ in-the-making
Champ in-the-making
Hi all
I have salution for that  Smiley Happy

I write in java one class and make it aviable for JS, now i write properties to task as:

var props = new Array();
var taskId = "jbpm$13";
props["bpm:description"] = "this is job for u";
props["today"] = new Date();
var added = scworkflow.setTaskProperties(taskId, props);
if (added) {
  logger.log("Your properties added successful");
}
It is so easy, isn't it :wink: