AnsweredAssumed Answered

Receive Task inside a Sub Process

Question asked by tahadakal on Feb 27, 2017
Latest reply on Feb 28, 2017 by tahadakal

I have a BPM which has a receive task inside a sub process.

 

When I try to signal the process instance execution after creation i get the following error :

java.lang.NullPointerException
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:406)
    at org.activiti.engine.impl.cmd.SignalCmd.execute(SignalCmd.java:43)
    at org.activiti.engine.impl.cmd.NeedsActiveExecutionCmd.execute(NeedsActiveExecutionCmd.java:55)
    at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
    at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
    at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37)
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
    at org.activiti.engine.impl.RuntimeServiceImpl.signal(RuntimeServiceImpl.java:231)

 

 

I have attached the BPMN : PNG and the XML(BPMN20)

 

 

Here is the process XML :

<process id="Basic_receive_task" name="BasicReceiveTask" isExecutable="true">
    <subProcess id="sub_process" name="sub process">
      <receiveTask id="receive_task" name="Receive Task"></receiveTask>
      <startEvent id="start_sub_process" name="start sub process"></startEvent>
      <endEvent id="end_sub_process" name="end sub process"></endEvent>
      <sequenceFlow id="to_receive_task" name="to receive task" sourceRef="start_sub_process" targetRef="receive_task"></sequenceFlow>
      <sequenceFlow id="from_receive_task" name="from receive task" sourceRef="receive_task" targetRef="end_sub_process"></sequenceFlow>
    </subProcess>
    <startEvent id="start_process" name="start process"></startEvent>
    <endEvent id="end_process" name="end process"></endEvent>
    <sequenceFlow id="sid-DDE7998A-D99D-4A4E-BFAA-3BC6CF33E6BB" sourceRef="sub_process" targetRef="end_process"></sequenceFlow>
    <sequenceFlow id="to_sub_process" name="to sub process" sourceRef="start_process" targetRef="sub_process"></sequenceFlow>
</process>

 

Am I missing something?

Please advice.

 

Thanks.

 

EDIT 1 (Junit):

@Test
public void test() {
     //initialize activiti engine
     RuntimeService runtimeService = activitiRule.getRuntimeService();
    
     //create WF
     ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("Basic_receive_task", "TEST");

     runtimeService.signal(processInstance.getId());

}

Outcomes