AnsweredAssumed Answered

Strange behaviour query/signal multi instance receive task

Question asked by aapthorp on Feb 18, 2013
Latest reply on Sep 12, 2014 by aggiepilot04
I have a process with a multi instance receive task i.e. one instance for the number of messages I expect to receive before the receive task completes.

When I query the receive task (as per the user guide but returning a list) I always get one extra execution returned. i.e. expect 2 get 3, etc. The returned ids always match what I find in the database (ACT_HI_ACTINST) except for the second one. I can never find this id.

The behaviour then gets stranger. If I signal the first execution I get an NPE error. However, signalling the second execution succeeds!

18-Feb-2013 19:40:49 org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
        at org.activiti.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior.leave(
        at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(
        at org.activiti.engine.impl.bpmn.behavior.ReceiveTaskActivityBehavior.signal(
        at org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior.signal(
        at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(
        at org.activiti.engine.impl.cmd.SignalCmd.execute(
        at org.activiti.engine.impl.cmd.NeedsActiveExecutionCmd.execute(
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(
        at org.activiti.spring.SpringTransactionInterceptor.execute(
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(
        at org.activiti.engine.impl.RuntimeServiceImpl.signal(
        at com.ajita.activiti.MessageSender.notify(
        at org.activiti.engine.impl.delegate.TaskListenerInvocation.invoke(

Has anyone else run into this issue or has no one else tried multi instance receive tasks?

I assume the reason for one extra task, is in effect a parent for each of the individual tasks, but then how is this stored in the database?

At what point does the individual multi task get marked as ended? When each one is signalled?