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

NullPointerException calling getStartFormKey for multi-start event processes

    XMLWordPrintable

Details

    • Bug Report
    • Status: Ready
    • L3 - Default
    • Resolution: Unresolved
    • 7.17.0
    • None
    • engine
    • None

    Description

      Environment (Required on creation):

      Camunda 7.17.0, all distros

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

      Calling `getFormService().getStartFormKey(processDefinitionId)` for a process definition with multiple start events leads to (on JDK 17):

      Caused by: java.lang.NullPointerException: Cannot invoke "org.camunda.bpm.engine.impl.form.FormDefinition.getFormKey()" because "formDefinition" is null
          at org.camunda.bpm.engine.impl.cmd.GetFormKeyCmd.execute(GetFormKeyCmd.java:84)
          at org.camunda.bpm.engine.impl.cmd.GetFormKeyCmd.execute(GetFormKeyCmd.java:40)
          at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
          at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
          at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
          at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35)
          at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
          at org.camunda.bpm.engine.impl.FormServiceImpl.getStartFormKey(FormServiceImpl.java:99)
      
          ... user code

      Steps to reproduce (Required on creation):

      1. Deploy a process definition with multiple start events
      2. Call getFormService().getStartFormKey(processDefinitionId) for that process definition

      Observed Behavior (Required on creation):

      NPE as described above

      Expected behavior (Required on creation):

      A meaningful NullValueException as thrown in GetStartFormCmd for example in the same setting

      Root Cause (Required on prioritization):

      • In GetFormKeyCmd lines 83 and 84, we expect there always to be a FormDefinition, which is not the case in 7.17.0 given the preconditions above.
        FormDefinition formDefinition = processDefinition.getStartFormDefinition();
        formKeyExpression = formDefinition.getFormKey();
        

      Solution Ideas (Optional):

      1. Throw a NullValueException stating the absence of a form definition for the start event

      Hints (optional):

      • The "get form key" behavior changed with regards to 7.16, where you would receive "null" instead of an NPE
      • Other form data related methods/commands throw NullValueExceptions in such setups

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              Unassigned Unassigned
              boris Boris Petrov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Salesforce