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

Output variables of type "script" are not processed following event-based gateway

    XMLWordPrintable

Details

    • Bug Report
    • Resolution: Duplicate
    • L3 - Default
    • None
    • 7.9.0, 7.9.5
    • engine
    • None
    • Reproduced using both JavaScript and Groovy as the script language

    Description

      Goal:
      Create a process model that contains an event-based gateway in which the triggered event modifies a process variable via a script on its Output tab in the model.

      Configuration:

      • BPMN file contains a manual task in which an process variable is successfully initialized as a script-type output variable. This demonstrates that scripts on output variables do work in some circumstances.
      • BPMN file contains an event-based gateway with both message and timer intermediate catch events
      • The catch events are configured with a script-type output parameter with the same variable name as created above
      • BPMN file invokes an Intermediate Message Throw after a delay timer to trigger the event gateway
      • As an alternative, the message delay timer can be increased so that the event gateway is triggered by its own "escape hatch" timer event
      • Script steps are invoked to print out the process variable values before and after the event gateway is triggered

      Expected Outcome
      All script-type output variables perform their operations to create or modify a process instance variable regardless of their location in the process flow.

      Actual Outcome
      Only the initial value is assigned to the variable in the output of the manual task. Neither the message receive event nor the timer event following the event-based gateway modify or update the value of the process variable. The log steps report unchanged values, and inspection of history in cockpit show no changes to the variable value.

      Desired Fix
      Modify the engine so that the script-type Output variables set or modify the process instance variable values properly when configured on events associated with an event-based gateway.

      Steps to Reproduce

      1. Deploy the attached event_gateway_output_script_failure.bpmn file to a process engine instance via the REST API.
      2. Use Tasklist to start the Event Gateway Output Script Failure process
      3. Monitor the stdout or relevant logfile for log statements produced by System.out.println calls in the two "log" steps
      4. Note that the "Initial" value of the "TestVariable" process variable instance is set by the script in the Output tab of the Manual Task
      5. Note that the "Final" value of the "TestVariable" process variable instance remains unmodified by the Output tab of the triggered Message Catch event.
      6. Optional: Modify the timer durations so that the Message Delay timer value exceeds the value of the "Escape Hatch" event. Observe that the timer event does not modify the value of the process variable.
      7. Optional: Observe the history of the process variable named "TestVariable" in Cockpit and observe that only the initial value is set and never modified.

      NOTES:

      • This behavior has been confirmed for both Javascript and Groovy script types on Output variables

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              Unassigned Unassigned
              dhallmark Daniel Hallmark
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce