cancel
Showing results for 
Search instead for 
Did you mean: 

Attaching a timer event to a usertask

vigneshr
Champ in-the-making
Champ in-the-making
Hi,

I am trying to create a user task which should be visible in the user queue but should automatically move to the next task in the workflow if the timer expires. Below is the code snippet for the same:
<userTask id="testTask" name="Test Task" activiti:candidateGroups="abc">
        <extensionElements>
          <activiti:formProperty id="domainEntity" variable="domainEntity" required="true"></activiti:formProperty>
        </extensionElements>
      </userTask>
      <boundaryEvent id="letterTimer" cancelActivity="true" attachedToRef="testTask">
     <timerEventDefinition>
        <timeDuration>PT1M</timeDuration>
   </timerEventDefinition>
      </boundaryEvent>

I am able to see the task in the candidate group but it doesn't move on to the next task automatically after 1 minute.
Even if I submit the task manually, I get the exception "this activity doesn't accept signals"
Please help in identifying the issue.
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
Please wrap all code in "code" tags (see Text format box below the comment-field)…

Anyway, seems like all you need is a task that is either complete by a person before a certain time OR after the date expires, have the process move on to the next task, skipping the first task.

This can be done by using a timer-boundary event on the first user task, with "cancelActivity = true" as an attribute. The outgoing flow of the timer-boundary event leads to task2, exactly the same as the sequence-flow starting from task1 (effectively having 2 arriving sequence-flows in task2).

On top of that, when inspecting the process-history (historicActivityInstances), you'll be able to see whether or not the task was completed normally or if the timer was executed.

Tried what you have suggested and it works now. Thanks!