cancel
Showing results for 
Search instead for 
Did you mean: 

Poller process

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

I have created an activiti process for the lifecycle of an email which passes many service tasks.

Now I have another process that polls emails from a queue and starts the new activiti email process everytime a new email is polled.
the poller process should never stop polling.

I understand that an activiti process(the poller) is not meant to never end?
I tried to make this work, but when an error occurs in 1 of my activiti email processes, the poller process also stops.

How should this be made?
I am thinking about the REST API?
(I create my poller outside of activiti, and I call the api everytime a new email process needs to be started?)

I really want to keep everything within my actviti explorer, but is this possible?

really need me some advice. Thanks
6 REPLIES 6

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

an jUnit test example could help me to understand your issue better, but I would say that poller activity call (subprocess call) is synchronous.
Make this call asynchronous. In that case new job will be created and failure of one subprocess won't cause failure of the parent process.

Another issue is that parent process will wait on the subprocess return. What I would do is:
1. Parent process instance should be started periodically (timer start event) (or you can implement it in java and schedule it with some scheduler)
2. this parent process has to decide whether call subprocess or not.

Regards
Martin
2.

robinho
Champ in-the-making
Champ in-the-making
I have created an asynchronous start timer event that calls a new mailing process (every 3 seconds).
I don't want the timer to wait till the mailing process ends.
I want to have multiple mail processes(each has his own lifecycle) running (ca 50K processes) at once, each started by the timer.
the asynchronous start timer is not doing this for me..

How can I make this work?

thanks

jbarrez
Star Contributor
Star Contributor
"the asynchronous start timer is not doing this for me.."

What part is it not doing for you? Multiple process instances at once (don't see why not) … or starting every 3 seconds?

robinho
Champ in-the-making
Champ in-the-making
I have an activiti start timer that starts a servicetask every 5 seconds.
In my service task I call my email process with the code:
<code> runtimeService.startProcessInstanceByKey("mailProcess", variables); </code>

I have set my servicetask asynchronous.
The problem is now that my mailProcess is not executed every 5 seconds (async).
Because the servicetask waits for my mailProcess to finish.

How can I solve this? thanks for any help

trademak
Star Contributor
Star Contributor
Hi,

Did you add an asynchronous definition to the steps in your mail process as well? If that's async, then the invocation of starting this process instance should return quickly.

Best regards,

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

Thanks for your answer, I didnt know the mailprocess had to be asynchronous as well.
I Made the full process async(every service task) & every servicetask has "exclusive no".
Now my mailprocess is executed async and executed multiple times by a start timer

Thanks