cancel
Showing results for 
Search instead for 
Did you mean: 

start multiple processes with start timer

robinho
Champ in-the-making
Champ in-the-making
Hi

How can I start the same process multiple times with 1 start timer event. The process needs to be started every second (asynchronously).

I tried to do this in different ways but the timer waits till the process ends before starting a new process.

I set the timer asynchronously (didn't work).
I set my first service task asynchonously (didn't work)

please any advice? Thank you
3 REPLIES 3

hari
Star Contributor
Star Contributor
Hi,

Have a scheduler trigger it at the specified time intervals.

robinho
Champ in-the-making
Champ in-the-making
I did that…

I tried this code on my servicetask(called by starttimer) that executes another process (async).

<code>
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    processEngine.getProcessEngineConfiguration().setAsyncExecutorActivate(true);
    processEngine.getProcessEngineConfiguration().setAsyncExecutorEnabled(true);
    AsyncExecutor asyncExecutor =   processEngine.getProcessEngineConfiguration().getAsyncExecutor();
    asyncExecutor.setDefaultAsyncJobAcquireWaitTimeInMillis(1000);
    processEngine.getProcessEngineConfiguration().setAsyncExecutor(asyncExecutor);
     RuntimeService runtimeService = processEngine.getRuntimeService();
    runtimeService.startProcessInstanceByKey("TTSProcess", sqsMessage);
</code>

My TTSProcess is called 2times every 8 seconds..(IF my current 2 processes are ended).
This is not what I want… and seems way to hard to get it fixed

trademak
Star Contributor
Star Contributor
Hi,

Can you include more information about your process definition, or event better, could you create a unit test showing your issue?

Best regards,