Skip to content

Subtraction of dates does not return days-time-duration, but a duration in hours #466

@rob2universe

Description

@rob2universe

Describe the bug
Subtraction of dates does not return days-time-duration (P5D), but a duration in hours (PT120H).

Documentation states :

First argument Second argument Result
date date days-time-duration

https://docs.camunda.io/docs/components/modeler/feel/language-guide/feel-temporal-expressions/#subtraction
but actual result is in hours.

To Reproduce

Run this process and check result:

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Web Modeler" exporterVersion="ac3bf19" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.0.0" camunda:diagramRelationId="514fd40d-5540-4a9d-9838-09aa23d6358f">
  <bpmn:process id="Process_f9a71f52-2581-421f-9c61-c7a9f6fcf61f" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:outgoing>Flow_1bu3582</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="Flow_1bu3582" sourceRef="StartEvent_1" targetRef="Activity_1thogsb"/>
    <bpmn:userTask id="Activity_1thogsb" name="Check Duration">
      <bpmn:extensionElements>
        <zeebe:ioMapping>
          <zeebe:input source="= date(&quot;2020-04-06&quot;) - date(&quot;2020-04-01&quot;)" target="result"/>
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1bu3582</bpmn:incoming>
      <bpmn:outgoing>Flow_0wchbw2</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:endEvent id="Event_16zrfda">
      <bpmn:incoming>Flow_0wchbw2</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_0wchbw2" sourceRef="Activity_1thogsb" targetRef="Event_16zrfda"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_f9a71f52-2581-421f-9c61-c7a9f6fcf61f">
      <bpmndi:BPMNEdge id="Flow_1bu3582_di" bpmnElement="Flow_1bu3582">
        <di:waypoint x="186" y="118"/>
        <di:waypoint x="240" y="118"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0wchbw2_di" bpmnElement="Flow_0wchbw2">
        <di:waypoint x="340" y="118"/>
        <di:waypoint x="402" y="118"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="150" y="100" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0zehzx6_di" bpmnElement="Activity_1thogsb">
        <dc:Bounds x="240" y="78" width="100" height="80"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_16zrfda_di" bpmnElement="Event_16zrfda">
        <dc:Bounds x="402" y="100" width="36" height="36"/>
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

Expected behavior
Return P5D instead of PT120H

Environment

  • Camunda 8 Saas

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions