cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] Editing Properties in a workflow task

hyperation
Champ on-the-rise
Champ on-the-rise
Hi,

I am wondering if there is anyway in Webscript (Javascript) to set a workflow task property?

For instance if I want to change bpm:comment to "Test", what would be the Javascript code for it?

I tried doing


var task.workflow.getTaskById(<id>);
task.properties['bpm:comment'] = "Test";

That didn't work.  I was only able to read but not write to the property.

Any suggestion or comment is appreciated.

Thanks
Smiley Happy
3 REPLIES 3

raptus
Champ in-the-making
Champ in-the-making
I'm not sure because I am a beginner but I think the correct code is like this:

task.parameters['bpm:comment'] = "Test";

As this example (used for starting a workflow instance):

var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$ep:document";
workflow.parameters["bpm:workflowDescription"] = "description: you can write everything";

But I repeat… I'm not sure…try reading the workflow javascript apis…

hyperation
Champ on-the-rise
Champ on-the-rise
I'm not sure because I am a beginner but I think the correct code is like this:

task.parameters['bpm:comment'] = "Test";

As this example (used for starting a workflow instance):

var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$ep:document";
workflow.parameters["bpm:workflowDescription"] = "description: you can write everything";

But I repeat… I'm not sure…try reading the workflow javascript apis…


Hi raptus,

Thanks for the info, but I'm actually trying to change the properties of an already running workflow (task).

Thanks
Smiley Happy

hyperation
Champ on-the-rise
Champ on-the-rise
Hi,

Got a reply with Alfresco, the Javascript API for setting task properties such as setProperties() has not been implemented yet.  So, instead, go with the Java-backed webscript route and use WorkflowServices.

Thanks
Smiley Happy