cancel
Showing results for 
Search instead for 
Did you mean: 

boundaryEvent doesn't trigger

nilsz
Champ in-the-making
Champ in-the-making
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?
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
Did you enable the job executor? If you don't have it enabled, jobs (like the timer) will never trigger.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.