AnsweredAssumed Answered

Web scripts and Workflows

Question asked by ricny046 on Oct 21, 2009
Latest reply on Oct 22, 2009 by ricny046

I'm trying to modify the following web script a little bit to be able to also add a comment when a task is ended:

function main()
   // Task ID
   var taskId = url.templateArgs.taskId;
   if (taskId === undefined)
      status.setCode(status.STATUS_BAD_REQUEST, "TaskID missing when ending task.");

   // Check TaskId is valid
   var task = workflow.getTask(taskId);
   if (task === null)
      status.setCode(status.STATUS_BAD_REQUEST, "Invalid TaskID when ending task.");
   model.taskId = taskId;
   // Optional Transition ID
   var transitionId = url.templateArgs.transitionId;
   if (transitionId === undefined)
      transitionId = null;
   }["bpm:comment"] = "test"
   model.transitionId = transitionId;


The row that I have added is["bpm:comment"] = "test" just to see if I can add a comment. But the comment is not set and not displayed in the Workflow history. What am I doing wrong?