AnsweredAssumed Answered

Ending a userTask from a TimerEvent using the task.endTask(transitionId) method

Question asked by darkredd1 on Apr 22, 2013
Latest reply on Apr 24, 2013 by darkredd1
Hi to all,

I am working on a workflow that has a multiInstance process, I have a requirement to escalate a task if not complete in time (specified).
I am using a timerEvent to trigger this action. However, the task does not end using the endTask() method. Here is a snippet code of what we are working on:

<scriptTask id="reminderMail">
          <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
             <activiti:field name="script">
                   var workDef = workflow.getDefinitionByName("activiti$submissionWorkflow");
                   var instances = workDef.getActiveInstances();
                  var taskid = "activiti$" + execution.getVariable('recotaskId');
                  var instance = instances[0];
                  var paths = instance.paths;
                  var alltasks = paths[0].tasks;
                  execution.setVariable('sita_reviewOutcome', "Recommend");
                  var counter = alltasks[0].transitions;

                  logger.log(alltasks[0].name + " task name kkkkkkkkkkkkkkkkkkk");

Our multi-Instance task has two possible outcomes: Recommend or Reject; which leads an exclusive gateway to assess the decision.
What we get is an error about the transaction failing because it does not know where to go after the endTask method.

Thanks for the help in advance