Hi all,
I have following business case:
User wants to receive notifications N days before particular task due date. Moreover, there is possibility to change due date from application.
So, I've created user task and timer boundary event, which is connected with it. Everything works fine - when user task is active in process, notification is sent to the user on calculated date based on process variable. However, timer boundary event does not finish user task. In this case, when timer boundary event is fired and job is completed, user can change due date in application and expects next notification N day before new due date. Unfortunately, when user changes due date, new job is not created. I suppose I have to create it manually, but API does not allow such kind of operation. I am able to do it by direct iBatis call:
dbSqlSession.getSqlSession().insert("insertTimer", timerEntity);
It is not good solution. Could you please help me with this case? Thank you in advance.
Assuming you have the TimerEntity definition, have you tried:
import org.activiti.engine.impl.context.Context;
...
...
Context.getCommandContext().getJobEntityManager().schedule(myTimerEntity);
Ultimately it does the same thing you are doing, but you aren't making an explicit iBatis call.
Let me know how it goes.
Greg
P.S. Id be interested in how you are retrieving/constructing the TimerEntity since it will be gone as soon as the timer fires.
Thank you for your response.
I figured it out and it works now. For new timers (jobs) I use:
commandContext.getJobEntityManager().insert(timerEntity);
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.