cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti process result to queue

tj1
Champ in-the-making
Champ in-the-making
Hi guys,

we implemented pooling of processes in Activiti, now we are doing calls every 20s to get completed processes at that time. Recently we decided to changed that behavior to pub-sub. Basically when Activiti process is finished the same data as result from "/query/historic-process-instances" is published to the queue. 

The best way I found is to subscribe to "PROCESS_COMPLETED,PROCESS_CANCELLED" using ActivitiEventListener. Everything works with that well, except when we have issues related to the queue. service is down or so. If it happens, then I will get an exception in EventListener. In that case if I set isFailOnException() return false, then I will lose the information about ended process, if I set true, then the previous successful steps of transaction will be rollabacked.

Questions:
1) In given scenario is it possible somehow to repeat only the EventListener action without the one or more tasks which were included in transaction?
2) Maybe you know other options or extension points where I can put the data to the queue after process is finished and be able to retry if adding failed?

P.S. I know that I can create separate tasks which could do that. Smiley Happy But that IMOP shouldn't be in business process.

Best Regards,
TJ
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
Yeah, my first thought was to make it a task and make that async … but I agree it's not the nicest to have that in your process definition.
You could look into creating a custom job type (like we now have for the async jobs and the timer jobs) that executes your custom logic when it's picked up.

I think you'll have to choose between rolling back or storing the information somewhere intermediary (but not being pub/sub anymore)