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

Camunda-Spin: Variables cannot be removed or set to null

XMLWordPrintable

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L2 - Critical L2 - Critical
    • 7.2.0, 7.2.0-alpha6
    • 7.2.0-alpha4
    • spin

      it seems that camunda-spin has a problem when a variable is set to null. We try to set a variable (enum) to null, or remove a variable.

      Example 1:
      1. Start process with process variables
      2. Complete task and set one of the process variables to null ( taskService.complete(taskId, map); )
      Exception:

      java.lang.IllegalArgumentException: SPIN-01001 Parameter 'parameter' is null
              at org.camunda.spin.logging.SpinCoreLogger.parameterIsNullException(SpinCoreLogger.java:34)
              at org.camunda.spin.impl.util.SpinEnsure.ensureNotNull(SpinEnsure.java:41)
              at org.camunda.spin.impl.SpinFactoryImpl.createSpinFromObject(SpinFactoryImpl.java:150)
              at org.camunda.bpm.engine.impl.spin.SpinSerializationType.setValue(SpinSerializationType.java:55)
              at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.setValue(VariableInstanceEntity.java:239)
              at org.camunda.bpm.engine.impl.variable.AbstractVariableStore.setVariableInstanceValue(AbstractVariableStore.java:112)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.updateVariableInstance(CoreVariableScope.java:302)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.setVariableLocal(CoreVariableScope.java:249)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.setVariable(CoreVariableScope.java:221)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.setVariable(CoreVariableScope.java:216)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.setVariables(CoreVariableScope.java:172)
              at org.camunda.bpm.engine.impl.persistence.entity.TaskEntity.setExecutionVariables(TaskEntity.java:599)
              at org.camunda.bpm.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:49)
              at org.camunda.bpm.engine.impl.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:27)
              at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
              at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:90)
              at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)
              at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:38)
              at org.camunda.bpm.engine.impl.TaskServiceImpl.complete(TaskServiceImpl.java:122)
      

      Example 2:
      1. Start process with process variables
      2. Explicitly delete one of the process variables ( runtimeService.removeVariable(processInstanceId, key); )
      3. org.camunda.bpm.engine.impl.variable.AbstractVariableStore#removeVariableInstance makes:
      variable.delete();
      variable.setValue(null);

      Question: Why is the entity deleted and in the next line the value is set to null?
      Exception:

      java.lang.IllegalArgumentException: SPIN-01001 Parameter 'parameter' is null
              at org.camunda.spin.logging.SpinCoreLogger.parameterIsNullException(SpinCoreLogger.java:34)
              at org.camunda.spin.impl.util.SpinEnsure.ensureNotNull(SpinEnsure.java:41)
              at org.camunda.spin.impl.SpinFactoryImpl.createSpinFromObject(SpinFactoryImpl.java:150)
              at org.camunda.bpm.engine.impl.spin.SpinSerializationType.setValue(SpinSerializationType.java:55)
              at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.setValue(VariableInstanceEntity.java:239)
              at org.camunda.bpm.engine.impl.variable.AbstractVariableStore.removeVariableInstance(AbstractVariableStore.java:101)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.removeVariableLocal(CoreVariableScope.java:297)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.removeVariableLocal(CoreVariableScope.java:289)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.removeVariable(CoreVariableScope.java:275)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.removeVariable(CoreVariableScope.java:270)
              at org.camunda.bpm.engine.impl.core.variable.CoreVariableScope.removeVariables(CoreVariableScope.java:202)
              at org.camunda.bpm.engine.impl.cmd.RemoveExecutionVariablesCmd.execute(RemoveExecutionVariablesCmd.java:42)
              at org.camunda.bpm.engine.impl.cmd.RemoveExecutionVariablesCmd.execute(RemoveExecutionVariablesCmd.java:15)
              at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
              at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:90)
              at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)
              at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:38)
              at org.camunda.bpm.engine.impl.RuntimeServiceImpl.removeVariable(RuntimeServiceImpl.java:144)
      

      In both examples org.camunda.bpm.engine.impl.spin.SpinSerializationType#setValue is called to set null as variable value.

        This is the controller panel for Smart Panels app

              thorben.lindhauer Thorben Lindhauer
              sreiterer Stefan Reiterer
              Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: