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

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">

    <sequenceFlow id="flow_start" sourceRef="start" targetRef="retrieve_data"></sequenceFlow>
    <serviceTask id="retrieve_data" name="Retrieve New Data" activiti:class=""></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);
   System.out.println("Minute has passed, go check tmp!");

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