AnsweredAssumed Answered

startEvent with Timer and repeat only executing once

Question asked by celery on Jun 29, 2016
Latest reply on Jun 30, 2016 by celery
Hello,

Just started playing around with Activiti and am having trouble getting a timer to fire off multiple times.

I have a startEvent with a timer in my bpmn20.xml file:

<process id="TimerAutoExec" isExecutable="true">
    <documentation>Timer Auto Exec</documentation>
    <startEvent id="start">
      <timerEventDefinition>
        <timeCycle>R3/PT1M</timeCycle>
      </timerEventDefinition>
    </startEvent>

    <sequenceFlow id="flow_start" sourceRef="start" targetRef="retrieve_data"></sequenceFlow>
    <serviceTask id="retrieve_data" name="Retrieve New Data" activiti:class="gov.nasa.jpl.analytics.AutoRetrieveData"></serviceTask>


The serviceTask class is just creating a dummy file in my /tmp directory using the current timestamp as a filename.
Only one file ever gets created…but it should be firing off 3 times total, once every minute(for three files).

I've verified that the AsyncExecutor is enabled and activated in my config file so I think I might just be missing some easy "go" command to actually kick it off?

This is the entire content of my main method in my java code:


ProcessEngine processEngine =  ProcessEngines.getDefaultProcessEngine();
System.out.println("AsyncExecutor isActive: "
   + processEngine.getProcessEngineConfiguration().getAsyncExecutor().isActive());
      
String process_name = "TimerAutoExec";
String proc_id = processEngine.getRuntimeService().startProcessInstanceByKey(process_name).getId();
System.out.println("Spawning Workflow " + proc_id);
            
while(true)
{
   TimeUnit.SECONDS.sleep(60);
   System.out.println("Minute has passed, go check tmp!");
}


Any help you could provide would be greatly appreciated! Thanks!

-Celery

Outcomes