AnsweredAssumed Answered

Subprocess and timer boundary

Question asked by marco.altieri_7813 on Oct 3, 2016
I tried to implement a very simple sub process with one user task and one email task.
The email task is started by a timer boundary attached to the user task.
The timer boundary is configured to send 5 emails, 1 per minute.

The 5 emails are sent all together after the first minute.

I found the same behaviour in a more complex workflow definition.

Is there something wrong in my definition?

Thanks
Marco


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="testSubProcess" name="Test Sub Process" isExecutable="true">
    <subProcess id="subprocess1" name="Sub Process">
      <userTask id="usertask1" name="User Task"></userTask>
      <startEvent id="startevent2" name="Start"></startEvent>
      <sequenceFlow id="flow3" sourceRef="startevent2" targetRef="usertask1"></sequenceFlow>
      <endEvent id="endevent2" name="End"></endEvent>
      <sequenceFlow id="flow4" sourceRef="usertask1" targetRef="endevent2"></sequenceFlow>
      <boundaryEvent id="boundarytimer1" name="Timer" attachedToRef="usertask1" cancelActivity="false">
        <timerEventDefinition>
          <timeCycle>R5/PT1M</timeCycle>
        </timerEventDefinition>
      </boundaryEvent>
      <serviceTask id="mailtask1" name="Mail Task" activiti:type="mail">
        <extensionElements>
          <activiti:field name="to">
            <activiti:string><![CDATA[maltieri@exari.com]]></activiti:string>
          </activiti:field>
          <activiti:field name="from">
            <activiti:string><![CDATA[maltieri@exari.com]]></activiti:string>
          </activiti:field>
          <activiti:field name="subject">
            <activiti:string><![CDATA[Subject]]></activiti:string>
          </activiti:field>
          <activiti:field name="text">
            <activiti:string><![CDATA[This is the body of the email]]></activiti:string>
          </activiti:field>
        </extensionElements>
      </serviceTask>
      <sequenceFlow id="flow5" sourceRef="boundarytimer1" targetRef="mailtask1"></sequenceFlow>
    </subProcess>
    <startEvent id="startevent1" name="Start"></startEvent>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="subprocess1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow2" sourceRef="subprocess1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_testSubProcess">
    <bpmndi:BPMNPlane bpmnElement="testSubProcess" id="BPMNPlane_testSubProcess">
      <bpmndi:BPMNShape bpmnElement="subprocess1" id="BPMNShape_subprocess1">
        <omgdc:Bounds height="363.0" width="481.0" x="361.0" y="120.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="510.0" y="294.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="boundarytimer1" id="BPMNShape_boundarytimer1">
        <omgdc:Bounds height="30.0" width="30.0" x="548.0" y="275.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="startevent2" id="BPMNShape_startevent2">
        <omgdc:Bounds height="35.0" width="35.0" x="420.0" y="304.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
        <omgdc:Bounds height="35.0" width="35.0" x="680.0" y="304.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="mailtask1" id="BPMNShape_mailtask1">
        <omgdc:Bounds height="55.0" width="105.0" x="510.0" y="160.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="180.0" y="284.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="990.0" y="284.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="455.0" y="321.0"></omgdi:waypoint>
        <omgdi:waypoint x="510.0" y="321.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="615.0" y="321.0"></omgdi:waypoint>
        <omgdi:waypoint x="680.0" y="321.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="563.0" y="275.0"></omgdi:waypoint>
        <omgdi:waypoint x="562.0" y="215.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="215.0" y="301.0"></omgdi:waypoint>
        <omgdi:waypoint x="361.0" y="301.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="842.0" y="301.0"></omgdi:waypoint>
        <omgdi:waypoint x="990.0" y="301.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Outcomes