cancel
Showing results for 
Search instead for 
Did you mean: 

After Boundary Time in Subprocess, not sending mail

rutenioh
Champ in-the-making
Champ in-the-making
Hello,
I am developing with activiti 5.10 and I am testing boundary timers in subprocess.
My surprise is when the timer ends, there is a Mail Task that is not working because the mail doesn't send to the address.

This is the process, the first mail task is only for testing if the mail server works. I receive this mail correctly.

Am I doing something wrong?

<?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" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="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="pruebaMailTimer" name="pruebaMailTimer" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <endEvent id="endevent1" name="End"></endEvent>
    <subProcess id="subprocess1" name="Sub Process">
      <startEvent id="startevent2" name="Start"></startEvent>
      <userTask id="usertask1" name="User Task"></userTask>
      <sequenceFlow id="flow2" sourceRef="startevent2" targetRef="usertask1"></sequenceFlow>
      <endEvent id="endevent2" name="End"></endEvent>
      <sequenceFlow id="flow3" sourceRef="usertask1" targetRef="endevent2"></sequenceFlow>
    </subProcess>
    <sequenceFlow id="flow4" sourceRef="startevent1" targetRef="mailtask2"></sequenceFlow>
    <sequenceFlow id="flow5" sourceRef="subprocess1" targetRef="endevent1"></sequenceFlow>
    <boundaryEvent id="boundarytimer1" name="Timer" attachedToRef="subprocess1" cancelActivity="true">
      <timerEventDefinition>
        <timeDuration>PT1M</timeDuration>
      </timerEventDefinition>
    </boundaryEvent>
    <serviceTask id="mailtask1" name="Mail Task" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to">
          <activiti:string><![CDATA[hectorg@ocu.es]]></activiti:string>
        </activiti:field>
        <activiti:field name="charset">
          <activiti:string><![CDATA[ISO-8859-15]]></activiti:string>
        </activiti:field>
        <activiti:field name="html">
          <activiti:string><![CDATA[Prueba]]></activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow6" sourceRef="boundarytimer1" targetRef="mailtask1"></sequenceFlow>
    <sequenceFlow id="flow7" sourceRef="mailtask1" targetRef="endevent1"></sequenceFlow>
    <serviceTask id="mailtask2" name="Mail Task" activiti:type="mail">
      <extensionElements>
        <activiti:field name="to">
          <activiti:string><![CDATA[hectorg@ocu.es]]></activiti:string>
        </activiti:field>
        <activiti:field name="charset">
          <activiti:string><![CDATA[ISO-8859-15]]></activiti:string>
        </activiti:field>
        <activiti:field name="html">
          <activiti:string><![CDATA[empieza prueba]]></activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow8" sourceRef="mailtask2" targetRef="subprocess1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_pruebaMailTimer">
    <bpmndi:BPMNPlane bpmnElement="pruebaMailTimer" id="BPMNPlane_pruebaMailTimer">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="50.0" y="264.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="780.0" y="234.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="subprocess1" id="BPMNShape_subprocess1">
        <omgdc:Bounds height="205.0" width="401.0" x="320.0" y="160.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="startevent2" id="BPMNShape_startevent2">
        <omgdc:Bounds height="35.0" width="35.0" x="350.0" y="240.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="440.0" y="230.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
        <omgdc:Bounds height="35.0" width="35.0" x="600.0" y="247.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="boundarytimer1" id="BPMNShape_boundarytimer1">
        <omgdc:Bounds height="30.0" width="30.0" x="560.0" y="340.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="mailtask1" id="BPMNShape_mailtask1">
        <omgdc:Bounds height="55.0" width="105.0" x="680.0" y="420.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="mailtask2" id="BPMNShape_mailtask2">
        <omgdc:Bounds height="55.0" width="105.0" x="183.0" y="280.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="385.0" y="257.0"></omgdi:waypoint>
        <omgdi:waypoint x="440.0" y="257.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="545.0" y="257.0"></omgdi:waypoint>
        <omgdi:waypoint x="600.0" y="264.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="85.0" y="281.0"></omgdi:waypoint>
        <omgdi:waypoint x="183.0" y="307.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="721.0" y="262.0"></omgdi:waypoint>
        <omgdi:waypoint x="780.0" y="251.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="575.0" y="370.0"></omgdi:waypoint>
        <omgdi:waypoint x="732.0" y="420.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="732.0" y="420.0"></omgdi:waypoint>
        <omgdi:waypoint x="797.0" y="269.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="288.0" y="307.0"></omgdi:waypoint>
        <omgdi:waypoint x="320.0" y="262.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
11 REPLIES 11

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Could you create jUnit test please?
http://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin

rutenioh
Champ in-the-making
Champ in-the-making
I create the jUnit test but it is very simple. I only start the process, it does not need any more.
I have created the project but I can not upload anything in zip type so I upload the process and the test in txt type.
To test it, only change the mail address.

Database is Oracle.

vasile_dirla
Star Contributor
Star Contributor
just rename the zip extension to txt and write that in your post.
(it's more useful to have the full zip file with the pom file, structure, etc.. so we just run it and see what's happening)

rutenioh
Champ in-the-making
Champ in-the-making
Thank you very much!!

martin_grofcik
Confirmed Champ
Confirmed Champ
Use H2 instead of oracle, please.

Regards
Martin

trademak
Star Contributor
Star Contributor
I also would like to comment that Activiti 5.10 is really old. So it would be good to upgrade to a more recent version of Activiti.

Best regards,

rutenioh
Champ in-the-making
Champ in-the-making
Hello,
I test with h2 and with Activiti 5.17.
The result is the same, only sends the first mail but the second after timer does not.

Smiley Sad

rutenioh
Champ in-the-making
Champ in-the-making
I have observed an unusual behaviour when boundary timers and mail tasks are involved.
For instance, I make a process with a User Task, a boundary timer in it and a mail task after.
The result is process continue without send the mail…

Do you have the same problem??

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Attach the test project.

Regards
Martin