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

Global Tasklistener does not get triggered when task variables get changed

    • Icon: Bug Report Bug Report
    • Resolution: None
    • Icon: L3 - Default L3 - Default
    • None
    • 7.13.1
    • engine
    • None

      Environment (Required on creation):

      Springboot Example Project from https://docs.camunda.org/get-started/spring-boot/.

      Running on MacOSX with Java 11

      openjdk 11.0.7 2020-04-14 LTS
      OpenJDK Runtime Environment Zulu11.39+15-CA (build 11.0.7+10-LTS)
      OpenJDK 64-Bit Server VM Zulu11.39+15-CA (build 11.0.7+10-LTS, mixed mode)

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      We are trying to implement a own task list for performance reasons. For doing this we are using a global Tasklisterner. Alle the events are captured as expected. But there seems to be on exception. When we are trying to change a variable via the REST API this will not trigger the global tasklistener.

      Steps to reproduce (Required on creation):

      We have adjusted to springboot example project to register a global tasklistener via the SpringBoot Event Bridge (org/camunda/bpm/getstarted/loanapproval/WebappExampleProcessApplication.java)

      You find that example project attached to this ticket.

      When starting the springboot app a loanApproval process instance is started automatically and will waiting in the user task of this process.

      We are using the cockpit to get the ID of that very task instance.

      We manipulate the variables of this task via the REST-API.

      PUT http://localhost:8080/engine-rest/task/62a5e204-ceab-11eb-aa18-acde48001122/variables/testVar
      Content-Type: application/json
      
      {"value" : "test", "type": "String"}

      Observed Behavior (Required on creation):

       

      Our global tasklistener is not triggered.

      Expected behavior (Required on creation):

      The global tasklistener should be triggered.

      Root Cause (Required on prioritization):

      Solution Ideas (Optional):

      Hints (Optional):

      All other interactions with a task, even add a task comment seems to be working fine to get the global tasklistener triggered. Only variable manipulation seems not to work.

       

      In a customers project we are using currently Camunda version 7.13.1-ee but the observed behavior is still valid up to the very latest version as well.

        This is the controller panel for Smart Panels app

            [CAM-13671] Global Tasklistener does not get triggered when task variables get changed

            Hello Colibiri,

            The observed behavior is expected. The task listeners listens only on the following events:

            • task completion
            • task assignment
            • task creation
            • task deletion
            • task update

            With other words, the task event listener will not fetch adding, updating variables. Find more details about the task listeners in our User Guide [1].

            To listen for variable updates, you can use a History Event listener:

              @EventListener
              public void onHistoryEvent(HistoryEvent historyEvent) {
                // ...
              }
            

            To fetch details of the variable, you can use the historic event for variables: org.camunda.bpm.engine.impl.history.event.HistoricVariableUpdateEventEntity

            As the described behavior is expected, I will close the ticket.

            [1]: https://docs.camunda.org/manual/latest/user-guide/process-engine/delegation-code/#task-listener-event-lifecycle

            Best,
            Yana

            Yana Vasileva added a comment - Hello Colibiri , The observed behavior is expected. The task listeners listens only on the following events: task completion task assignment task creation task deletion task update With other words, the task event listener will not fetch adding, updating variables. Find more details about the task listeners in our User Guide [1] . To listen for variable updates, you can use a History Event listener: @EventListener public void onHistoryEvent(HistoryEvent historyEvent) { // ... } To fetch details of the variable, you can use the historic event for variables: org.camunda.bpm.engine.impl.history.event.HistoricVariableUpdateEventEntity As the described behavior is expected, I will close the ticket. [1] : https://docs.camunda.org/manual/latest/user-guide/process-engine/delegation-code/#task-listener-event-lifecycle Best, Yana

              Unassigned Unassigned
              Colibiri Daniel Tonn
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: