Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-1537

Closing parallel gateway - no endtime in act_hi_actinst table

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • 7.1.0, 7.0.5, 7.1.0-alpha2
    • 7.0.3
    • engine
    • None

      A closing parallel gateway activity doesn't have an endTime timestamp written to the act_hi_actinst table, even after the process has finished - see attached database output (bd_h_actinst_tbl.jpg). Other than appearance, I can't see any other untoward effects on the process. Please see attached process diagram for the structure used (process_dia.jpg).

      user forum post:
      https://groups.google.com/forum/#!topic/camunda-bpm-users/ZHx8i2R3Frs

      Test case is to come

        This is the controller panel for Smart Panels app

            [CAM-1537] Closing parallel gateway - no endtime in act_hi_actinst table

            Hi Clint,

            thanks for reporting. Testcase would be great to have, thanks for that.

            You are using version 7.0.3?

            Cheers
            Robert

            Robert Gimbel added a comment - Hi Clint, thanks for reporting. Testcase would be great to have, thanks for that. You are using version 7.0.3? Cheers Robert


            It was an assumption. I did a git fetch upstream to retrieve a fix for this bug: CAM-1371. It stated the fix version was 7.0.3. I was testing with this code when I discovered the issue.

            clint.manning added a comment - It was an assumption. I did a git fetch upstream to retrieve a fix for this bug: CAM-1371 . It stated the fix version was 7.0.3. I was testing with this code when I discovered the issue.

            Proposed test location in the engine project
            org.camunda.bpm.engine.test.bpmn.gateway.ParallelGatewayTest

            Below is the Test code. It fails because the last gateway query returns null for the end timestamp when it shouldn't. Attached is the process definition file ParallelGatewayTest.testGatewayEndTimes.bpmn20.xml

            /**

            • https://app.camunda.com/jira/browse/CAM-1537
              */
              @Deployment
              public void testGatewayEndTimes() { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("gatewayEndTimes"); TaskQuery query = taskService.createTaskQuery().orderByTaskName().asc(); List<Task> tasks = query.list(); taskService.complete(tasks.get(0).getId()); taskService.complete(tasks.get(1).getId()); // process instance should have finished assertNotNull(historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstance.getId()).singleResult().getEndTime()); // gateways should have end timestamps assertNotNull(historyService.createHistoricActivityInstanceQuery().activityId("Gateway_0").singleResult().getEndTime()); assertNotNull(historyService.createHistoricActivityInstanceQuery().activityId("Gateway_1").list().get(0).getEndTime()); }

            clint.manning added a comment - Proposed test location in the engine project org.camunda.bpm.engine.test.bpmn.gateway.ParallelGatewayTest Below is the Test code. It fails because the last gateway query returns null for the end timestamp when it shouldn't. Attached is the process definition file ParallelGatewayTest.testGatewayEndTimes.bpmn20.xml /** https://app.camunda.com/jira/browse/CAM-1537 */ @Deployment public void testGatewayEndTimes() { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("gatewayEndTimes"); TaskQuery query = taskService.createTaskQuery().orderByTaskName().asc(); List<Task> tasks = query.list(); taskService.complete(tasks.get(0).getId()); taskService.complete(tasks.get(1).getId()); // process instance should have finished assertNotNull(historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstance.getId()).singleResult().getEndTime()); // gateways should have end timestamps assertNotNull(historyService.createHistoricActivityInstanceQuery().activityId("Gateway_0").singleResult().getEndTime()); assertNotNull(historyService.createHistoricActivityInstanceQuery().activityId("Gateway_1").list().get(0).getEndTime()); }

            Daniel Meyer added a comment - See pull request: https://github.com/camunda/camunda-bpm-platform/pull/54

            Backport to 7.0.5?

            Roman Smirnov added a comment - Backport to 7.0.5?

            Yes, if we do not see any special risks we should backport.

            Robert Gimbel added a comment - Yes, if we do not see any special risks we should backport.

            Done

            Roman Smirnov added a comment - Done

              smirnov Roman Smirnov
              clint.manning clint.manning
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: