AnsweredAssumed Answered

boundaryEvent doesn't trigger

Question asked by nilsz on Apr 5, 2016
Latest reply on Apr 7, 2016 by jbarrez
Whatever I try, my boundaryEvents don't trigger. Here's the XML:


<sequenceFlow id="flow-0" sourceRef="startevent" targetRef="storeUser"/>

<serviceTask id="storeUser" name="store user" activiti:delegateExpression="${storeUserDelegate}">
</serviceTask>


<serviceTask id="sendActivationEmail" name="Send activation email" activiti:type="mail">
   ….
</serviceTask>

<sequenceFlow id="flow-2" sourceRef="storeUser" targetRef="sendActivationEmail"/>

<sequenceFlow id="flow-3b" sourceRef="activationReminderTimer" targetRef="sendReminderEmail"/>
<sequenceFlow id="flow-3a" sourceRef="sendActivationEmail" targetRef="activateUserAccount"/>

<userTask id="activateUserAccount" name="activate account" />


<boundaryEvent id="activationReminderTimer"
                attachedToRef="activateUserAccount" cancelActivity="false">
     <timerEventDefinition>
         <timeDuration>PT2S</timeDuration>
     </timerEventDefinition>
</boundaryEvent>

<serviceTask id="sendReminderEmail" name="Send reminder email" activiti:type="mail">
   …..
</serviceTask>


Here's the relevant code for the test:

    @Test
    public void userRegistration() throws InterruptedException {
        User user = createUser(UserType.CLIENT);
        final ProcessInstance processInstance = userService.launchUserRegistrationProcess(user);
        assertNotNull(processInstance);
        final long count = runtimeService.createProcessInstanceQuery().count();
        assertEquals(1L, count);
        assertEquals("activate account", util.getActiveTaskName(processInstance));

        // mail should have been send
      assertEquals("An activation email should've been send", 1, wiser.getMessages().size());
      try {
         final MimeMessage msg = wiser.getMessages().get(0).getMimeMessage();
         assertNotNull("Message was null", msg);
         assertEquals("Subject did not match", "Activate your account", msg.getSubject());

      } catch (MessagingException e) {
         fail(e.getMessage());
      }

        Thread.sleep(3000);

        // mail should have been send
        assertEquals("An reminder email should've been send", 2, wiser.getMessages().size());
        try {
            final MimeMessage msg = wiser.getMessages().get(0).getMimeMessage();
            assertNotNull("Message was null", msg);
            assertEquals("Subject did not match", "Activate your account", msg.getSubject());

        } catch (MessagingException e) {
            fail(e.getMessage());
        }
     }

The reminder email is never send, the event doesn't seem to trigger. Any ideas?

Outcomes