Flowable Engine Does Not Appear to Support ISO-8601 Durations Expressed in Weeks

Hello,

I’ve discovered the Flowable engine does not appear to support a Duration string expressed in weeks, such as P3W. You can see this fail, along with other Duration strings that work, in this gist: Test Various ISO-8601 Duration Strings in Flowable Engine · GitHub.

I’ve searched this forum and the open/closed issues in the Github project for any mention of this problem, but didn’t find anything related. The root of the problem comes from DurationHelper’s dependency on javax.xml.datatype.Duration, which is based on the W3C XML Schema “time span” which uses a format defined in Section 5.5.3.2 of ISO-8601 (namely PnYnMnDTnHnMnS), but ignores the provision for weeks in that same paragraph (namely, PnW).

Based on the top two lines in the following stack trace, I’m guessing I can get around this by configuring a custom BusinessCalendar. Is that the recommended approach, or should I log this as a bug?

org.flowable.common.engine.api.FlowableException: couldn't resolve duedate: P3W

	at org.flowable.common.engine.impl.calendar.DurationBusinessCalendar.resolveDuedate(DurationBusinessCalendar.java:37)
	at org.flowable.common.engine.impl.calendar.BusinessCalendarImpl.resolveDuedate(BusinessCalendarImpl.java:34)
	at org.flowable.engine.impl.util.TimerUtil.createTimerEntityForTimerEventDefinition(TimerUtil.java:133)
	at org.flowable.engine.impl.bpmn.behavior.IntermediateCatchTimerEventActivityBehavior.execute(IntermediateCatchTimerEventActivityBehavior.java:44)
	at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeActivityBehavior(ContinueProcessOperation.java:298)
	at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:175)
	at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:125)
	at org.flowable.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:88)
	at org.flowable.common.engine.impl.AbstractEngineConfiguration.lambda$new$0(AbstractEngineConfiguration.java:195)
	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:130)
	at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
	at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
	at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
	at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
	at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
	at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
	at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
	at org.flowable.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:131)
	at com.test.WaitTaskTest.testInterval(WaitTaskTest.java:85)