Hi,
I have an activiti that I would be triggering which is executed in asynchronous mode. I would need to keep checking the status for the job and when it reaches either a success/failure state, I would need to go to next task. How can I achieve this? Any suggestions?
When you say it is executing in async mode, is that a service task with property activiti:async set to true ? If so is there a reason you are using async mode ?
I've had a similar situation, trying to see if it may be relevant.
My whole process would run in async mode. To achieve this, I have set the activiti:async to true just for the first task in the process so that the rest of the steps/tasks would also be running in the async mode.
But the question I asked is for a step in the process where I am calling an ETL job that would take a while to complete. As soon as the service call is made to ETL component, it schedules the job and provides an id to track the status back. So, for me as soon as the I make the first call to trigger the job, I have to keep checking the status at regular intervals to see the status and make progress in the process.
I hope I clarified your question. For now, I am checking the status using the Java Thread.sleep() method and when the status is either success/failure,
Sorry posted before completing the message.
But with the current approach, I can't restart the process when something fails abruptly. Pls let me know if you have any additional questions.
I understand, so not sure if this is any help, but I have an event listener that needs to run code its own thread so I can safely use the engine API. I don't believe you can use the async flag on a listener, so I start a new thread myself and use a synchronisation object and wait / notify so the original thread waits and I can check if it was a sucess or failure.
As your ETL step could be a long transaction, you can also change the transaction timeout I believe, I haven't needed that myself but have seen it mentioned in the user guide.
Thanks PaulT _! I will check that.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.