-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
7.14.0
-
None
-
Camunda Tomcat 7.14 Docker image (running on Windows)
Steps to reproduce
- Deploy a BPMN model with a timer duration start event with the definition P4W
- Check the due date of the timer job
Observed behavior
The due date is wrong.
Expected behavior
The due date is exactly 4 weeks in the future from the creation date.
Root cause
- {DurationHelper}} has a constant MS_PER_WEEK which is an int: 7 * 24 * 60 * 60 * 1000 = 604.800.000
- The weeks from the expression are parsed into an int
- The weeks are multiplied with the MS_PER_WEEK
- 604.800.000 * 3 Weeks = 1.814.400.000 => fits into an int
- 604.800.000 * 4 Weeks = 2.419.200.000 => does not fit into an int (>2.147.483.647)
- The multiplication operation overflows and a negative value is returned which is passed to DatatypeFactory#newDuration
Solution
Force multiplication to result in a long by converting at least one factor into a long.