Hi,
I have a similar use case, where reminder emails need to be sent if the user task is not completed in 3 days. The user task on which the timer is attached is a multi instance parallel task. The user task itself should not be cancelled on the time trigger. I have attached the boundary timer to my concurrent approval task and have a sequence flow to an end event. I tried setting the cancelActivity to "false" and it threw exception every 3mins(have this set for testing purpose) , interestingly if I set the cancelAcitivity to "true", it works and the workflow ends. Is there any other setting I might be missing to attach the timer to a multi instance user task?
Below have copy/pasted my workflow config:
</sequenceFlow>
<boundaryEvent id="boundarytimer1" name="Timer" attachedToRef="concurrentApproval" cancelActivity="false">
<timerEventDefinition>
<timeDuration>PT3M</timeDuration>
</timerEventDefinition>
</boundaryEvent>
<endEvent id="endevent2" name="End"></endEvent>
<sequenceFlow id="flow27" sourceRef="boundarytimer1" targetRef="endevent2">
<extensionElements>
<activiti:executionListener event="take" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>
logger.log("SEND TIMER EMAIL");
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</sequenceFlow>
<userTask id="concurrentApproval" name="Concurrent Approval Task" activiti:assignee="${approverAssignee}" activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="runAs">
<activiti:string>admin</activiti:string>
</activiti:field>
<activiti:field name="script">
<activiti:string>if (task.getVariableLocal('wf_reviewOutcome') == 'Reject') {
var newApprovalRejectCount = wf_approvalRejectCount + 1;
execution.setVariable('wf_approvalRejectCount', newApprovalRejectCount);
}
execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.CiscoScriptTaskListener">
<activiti:field name="runAs">
<activiti:string>admin</activiti:string>
</activiti:field>
<activiti:field name="script">
<activiti:string> if (typeof bpm_workflowDueDate != 'undefined') task.dueDate = bpm_workflowDueDate
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="wf_groupApprovers" activiti:elementVariable="approverAssignee">
<completionCondition>wf_approvalRejectCount>1</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
12:42:16,388 ERROR [org.springframework.transaction.support.TransactionSynchronizationUtils] TransactionSynchronization.afterCompletion threw exception
java.lang.IllegalStateException: No value for key [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory@b3ef378] bound to thread [pool-5-thread-5]
at org.springframework.transaction.support.TransactionSynchronizationManager.unbindResource(TransactionSynchronizationManager.java:199)
at org.mybatis.spring.SqlSessionUtils$SqlSessionSynchronization.suspend(SqlSessionUtils.java:243)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.doSuspendSynchronization(AbstractPlatformTransactionManager.java:666)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.suspend(AbstractPlatformTransactionManager.java:569)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:418)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:347)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.jobexecutor.DecrementJobRetriesListener.execute(DecrementJobRetriesListener.java:38)
at org.activiti.spring.SpringTransactionContext$4.afterCompletion(SpringTransactionContext.java:82)
at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:996)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:971)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:874)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:822)
at org.springframework.transaction.support.TransactionTemplate.rollbackOnException(TransactionTemplate.java:161)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:134)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:36)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
12:45:16,603 ERROR [org.springframework.transaction.support.TransactionSynchronizationUtils] TransactionSynchronization.afterCompletion threw exception