AnsweredAssumed Answered

Does Activiti support cancelActivity='false' on boundary sig

Question asked by mindaugas on Aug 20, 2012
Latest reply on Dec 11, 2012 by mindaugas
Does Activiti support cancelActivity="false" on boundary signal event?



<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
   xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
   xmlns:activiti="http://activiti.org/bpmn"
   targetNamespace="Examples">
   <signal id="alertSignal" name="alert" />
   <process id="aaa">
      <startEvent id="start1" />
      <sequenceFlow sourceRef="start1" targetRef="ut1" />
        <userTask id="ut1" name="FIRST"/>
       <boundaryEvent id="signal" attachedToRef="ut1" cancelActivity="false">
         <signalEventDefinition signalRef="alertSignal" />   
       </boundaryEvent>   
      <sequenceFlow sourceRef="ut1" targetRef="endx" />
        <sequenceFlow sourceRef="signal" targetRef="ut2" />
        <userTask id="ut2" />
        <sequenceFlow sourceRef="ut2" targetRef="end2" />
      <endEvent id="endx" />
      <endEvent id="end2" />
   </process>
</definitions>


Java:

  public void test() {
    HashMap<String, Object> variables1 = new HashMap<String, Object>();
    variables1.put("processName", "catchSignal");
    ProcessInstance pi ;
    pi = runtimeService.startProcessInstanceByKey("aaa");
    assertEquals(1,  taskService.createTaskQuery().processInstanceId(pi.getProcessInstanceId()).count());
    runtimeService.signalEventReceived("alert");
    assertEquals(2,  taskService.createTaskQuery().processInstanceId(pi.getProcessInstanceId()).count());
    taskService.complete(taskService.createTaskQuery().taskName("FIRST").singleResult().getId());
    assertEquals(1,  taskService.createTaskQuery().processInstanceId(pi.getProcessInstanceId()).count());
    //assertProcessEnded(pi.getProcessInstanceId());
  }



error:
org.activiti.engine.ActivitiException: this activity doesn't accept signals
   at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.signal(FlowNodeActivityBehavior.java:53)
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:364)
   at org.activiti.engine.impl.persistence.entity.TaskEntity.complete(TaskEntity.java:156)
   at org.activiti.engine.impl.cmd.CompleteTaskCmd.completeTask(CompleteTaskCmd.java:63)
   at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:57)
   at org.activiti.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:1)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.TaskServiceImpl.complete(TaskServiceImpl.java:144)
   at org.activiti.engine.test.bpmn.event.signal.SignalEventTest.testSignalCatchBoundaryWithVariables(SignalEventTest.java:76)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at junit.framework.TestCase.runTest(TestCase.java:168)
   at org.activiti.engine.impl.test.PvmTestCase.runTest(PvmTestCase.java:75)
   at junit.framework.TestCase.runBare(TestCase.java:134)
   at org.activiti.engine.impl.test.AbstractActivitiTestCase.runBare(AbstractActivitiTestCase.java:90)
   at junit.framework.TestResult$1.protect(TestResult.java:110)
   at junit.framework.TestResult.runProtected(TestResult.java:128)
   at junit.framework.TestResult.run(TestResult.java:113)
   at junit.framework.TestCase.run(TestCase.java:124)
   at junit.framework.TestSuite.runTest(TestSuite.java:232)
   at junit.framework.TestSuite.run(TestSuite.java:227)
   at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  [org.activiti.engine.impl.interceptor.CommandContext]





and active id' is after signal received:
[signal, ut2]

Outcomes