unable to use Date process variable in timeDuration

Description

I am trying to define a timer that uses timeDuration. I want to use the �start/duration� syntax as described in the ISO8601 standard.

This is an example, where DueDate is a Date process variable.

<intermediateCatchEvent id="catchevent1" name="Event1">
<timerEventDefinition>
<timeDuration>${DueDate}/PT20S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>

We often want to use this scenario where we specify the start as well as the duration as defined in the ISO8601 standard.

This fails in Activiti engine down in DurationHelper because it cannot parse the Date string. The problem is that the JUEL handler coerces this Date process variable into a String, using the Date�s toString() method.
This is not in the ISO8601 format. If I instead use a String process variable such that the value is in the ISO8601 format, it works as expected.
We need to support the Date process variable as this matches implementation of our current users.

I have included a test case to reproduce. The error is:

  • EXCEPTION: org.activiti.engine.ActivitiException: couldn't resolve duedate: Invalid format: "Fri Jan 09 11:14:17 EST 2015"
    org.activiti.engine.ActivitiException: couldn't resolve duedate: Invalid format: "Fri Jan 09 11:14:17 EST 2015"
    at org.activiti.engine.impl.calendar.DurationBusinessCalendar.resolveDuedate(DurationBusinessCalendar.java:37)
    at org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl.prepareTimerEntity(TimerDeclarationImpl.java:133)
    at org.activiti.engine.impl.persistence.entity.ExecutionEntity.initialize(ExecutionEntity.java:351)

Environment

None

Assignee

Joram Barrez

Reporter

Stephanie Smith

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure