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

Helper mehod "job(activity)" not working when there are multiple jobs

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • assert-8.0.0
    • None
    • assert
    • None

      Created on behalf of the following issue:
      https://github.com/camunda/camunda-bpm-assert/issues/120

      Original description:
      "I have a process waiting at an intermediate message catch event, while at the same time there is a timer event subprocess. When I call BpmnAwareTests.job(activityIfOfTheMessageCatchEvent) it throws "Query return 2 results instead of max 1" because the JobQuery in ProcessInstanceAssert.java:630 finds both jobs, the message and the timer.

      I think it would be better to call the JobQuery not with the executionId, but with the activityId."

        This is the controller panel for Smart Panels app

            [CAM-10848] Helper mehod "job(activity)" not working when there are multiple jobs

            Tobias Metzke-Bernstein created issue -
            Tobias Metzke-Bernstein made changes -
            Status Original: Open [ 1 ] New: Ready [ 10005 ]
            Tobias Metzke-Bernstein made changes -
            Status Original: Ready [ 10005 ] New: Open [ 1 ]

            I created a minimal test case working with the model ProcessInstanceAssert-jobTimerMessage.bpmn which works absolutely fine with 2 existing job instances:

            @Test
            @Deployment(resources = "bpmn/ProcessInstanceAssert-jobTimerMessage.bpmn")
            public void testJob_MultipleTimerAndMessage() {
              ProcessInstance instance = runtimeService().startProcessInstanceByKey("process");
              assertThat(instance).isActive();
              assertThat(jobQuery().count()).isEqualTo(2L);
              assertThat(ProcessEngineTests.job("catchIt")).hasActivityId("catchIt");
            }
            

            Tobias Metzke-Bernstein added a comment - I created a minimal test case working with the model ProcessInstanceAssert-jobTimerMessage.bpmn which works absolutely fine with 2 existing job instances: @Test @Deployment(resources = "bpmn/ProcessInstanceAssert-jobTimerMessage.bpmn" ) public void testJob_MultipleTimerAndMessage() { ProcessInstance instance = runtimeService().startProcessInstanceByKey( "process" ); assertThat(instance).isActive(); assertThat(jobQuery().count()).isEqualTo(2L); assertThat(ProcessEngineTests.job( "catchIt" )).hasActivityId( "catchIt" ); }
            Tobias Metzke-Bernstein made changes -
            Attachment New: ProcessInstanceAssert-jobTimerMessage.bpmn [ 30155 ]
            Tobias Metzke-Bernstein made changes -
            Assignee New: Tobias Metzke-Bernstein [ tobias.metzke ]
            Tobias Metzke-Bernstein made changes -
            Link New: This issue is related to CAMTEAM-42 [ CAMTEAM-42 ]
            Tobias Metzke-Bernstein made changes -
            Link Original: This issue is related to CAMTEAM-42 [ CAMTEAM-42 ]
            Tobias Metzke-Bernstein made changes -
            Link New: This issue is related to CAMTEAM-43 [ CAMTEAM-43 ]
            Tobias Metzke-Bernstein made changes -
            Link Original: This issue is related to CAMTEAM-43 [ CAMTEAM-43 ]

              Unassigned Unassigned
              tobias.metzke Tobias Metzke-Bernstein
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: