cancel
Showing results for 
Search instead for 
Did you mean: 

send mails after every a particular period of time repeatedl

mhp
Champ in-the-making
Champ in-the-making
i want to send mails after every a particular period of time repeatedly..
For that i am starting the process like this:
Map<String, Object> vars = new HashMap<String, Object>();
      vars.put("sender", "arindam.sarkar@tekoptimize.com");
      vars.put("recipient", "mcaarindamsarkar@gmail.com");
      runtimeService.startProcessInstanceByKey("helloProcess1",vars);
and this is my bpmn20.xml code:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
             targetNamespace="http://activiti.org/bpmn20"
             xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:activiti="http://activiti.org/bpmn">

<process id="helloProcess1">     
<startEvent id="start">
    <timerEventDefinition>
        <timeCycle>R/PT1S</timeCycle> 
      </timerEventDefinition>
      </startEvent>  
  <sequenceFlow id="flow1" sourceRef="start" targetRef="print" >   
   <conditionExpression xsi:type="tFormalExpression"> <![CDATA[${printer.isStandardOrder()}]]></conditionExpression>
    </sequenceFlow>
<serviceTask id="print" activiti:type="mail">
      <extensionElements>
        <activiti:field name="from" expression="${sender}" />
        <activiti:field name="to" expression="${recipient}" />
        <activiti:field name="subject" expression="Onboard Request for your approval" />
        <activiti:field name="html">
          <activiti:expression>
            <![CDATA[
              <html>
                <body>
                  Hello ,<br/><br/>
                 
                  Thank you,<br/>
                 
                  ${sender}.
                </body>
              </html>
            ]]>
          </activiti:expression>
        </activiti:field>     
      </extensionElements>
    </serviceTask>  
  <sequenceFlow id="flow2" sourceRef="print" targetRef="end" />       
  <endEvent id="end" />     
  </process>

</definitions>


But in the second time it is unable to resolve those sender and recipient parameter..
How to solve this..
Can anyone help me?its very urgent…
1 REPLY 1

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise