we are migrating from Activiti to Flowable and facing the problem using timers. Everything was working fine with Activiti and Flowable v5.
public enum TimeCycleDefinition {
EVERY_DAY("0 0 12 * * ?", "Every day (default)"), // every day at 12:00
EVERY_2DAYS("0 0 12 1/2 * ?", "Every other day"), // every 2 days at 12:00
EVERY_3DAYS("0 0 12 1/3 * ?", "Every three days"), // every 3 days at 12:00
EVERY_5DAYS("0 0 12 1/5 * ?", "Every five days"), // every 5 days at 12:00
EVERY_10DAYS("0 0 12 1/10 * ?", "Every ten days"), // every 10 days at 12:00
EVERY_HOUR("0 0 0/1 * * ?", "Every hour"), // every hour
EVERY_4HOURS("0 0 0/4 * * ?", "Every 4 hours"), // every 4 hours
EVERY_8HOURS("0 0 0/8 * * ?", "Every 8 hours"), // every 8 hours
EVERY_12HOURS("0 0 0/12 * * ?", "Every 12 hours"), // every 12 hours
EVERY_MIN("0 0/1 * * * ?", "Every 1 min (test)"), // every minute (TEST)
NONE("0 0 0 1 1 ? 1970", "None"); // this event will never fire
private final String value;
private final String label;
…
}
If using the NONE value for timeCycle,
Flowable engine fails with NPE.
20:28:04,287 ERROR AbstractCommandContext:100 - Error while closing command context
java.lang.NullPointerException
at org.flowable.engine.impl.util.TimerUtil.createTimerEntityForTimerEventDefinition(TimerUtil.java:154)
…
if (repeat) {
String prepared = prepareRepeat(dueDateString); timer.setRepeat(prepared);
}
Here timer is null.
We use org.flowable.spring.SpringAdvancedBusinessCalendarManagerFactory
I tried to reproduce the issue. Without success.
Could you try to reproduce the issue in the jUnit test please?
mvn archetype to generate jUnit test template:
This was changed with commit 3c1c6e5ae532fd6793e1c474100e32ff2eaea705 on July 16, 2015. Prior to that commit the timer object was always allocated and not null.
The issue is that no due date can be determined with the example expression you used (0 0 0 1 1 ? 1970). You want no timer to be created in that case and the process just to continue?
Yes, we have process definitions where the initiator might decide whether use notifications or not as a part of the process. It can be every day/hour etc. but also no notification at all.
Would it be possible not to create the timer if due date is overdue already?
@alex.chabatar : do you mean a boundary timer event that may or may not be active dependening on the input of the initiator? Imho, the better solution would be to have an expression that evaluates a condition whether or not the boundary event should be created (and not only for timers). wdyt?