AnsweredAssumed Answered

Signal Event Subscription is in suspended state after resuming process

Question asked by prachi.mujumdar on Jan 16, 2014
Latest reply on Jan 16, 2014 by martin.grofcik
Hi,

I have Process A which I am suspending. As per business requirement when a particular condition is met, I need to resume the process and send a signal to it.

This works fine if I have single process instance in suspended state. But if I have multiple process instances of same process in suspended state then I get following error:

org.activiti.engine.ActivitiException: Cannot throw signal event 'SomeSignalName' because execution '2666' is suspended
   at org.activiti.engine.impl.cmd.SignalEventReceivedCmd.execute(SignalEventReceivedCmd.java:61)
   at org.activiti.engine.impl.cmd.SignalEventReceivedCmd.execute(SignalEventReceivedCmd.java:33)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:61)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.RuntimeServiceImpl.signalEventReceived(RuntimeServiceImpl.java:233)

I am using following code :

To suspend the process

runtimeService.suspendProcessInstanceById(processInstanceId);


To resume a process

runtimeService.activateProcessInstanceById(processInstanceId);


And to send event signal

ExecutionQuery executionQuery = runtimeService.createExecutionQuery().processInstanceId(processInstanceId).signalEventSubscriptionName(signalName);
        if (executionQuery != null) {
                   Execution execution = executionQuery.singleResult();
         runtimeService.signalEventReceived(eventSignal, execution.getId());
       }

Can anyone please help me in this?

Outcomes