Camunda-Spin: Problem with setting a variable null / deleting a variable

1,025 views
Skip to first unread message

markus...@gmail.com

unread,
Oct 6, 2014, 4:21:36 AM10/6/14
to camunda-...@googlegroups.com
Hi,

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.

Best regards,
Markus

ia.sre...@gmail.com

unread,
Oct 7, 2014, 1:51:27 AM10/7/14
to camunda-...@googlegroups.com, markus...@gmail.com
Created the following bug report: https://app.camunda.com/jira/browse/CAM-2834

Daniel Meyer

unread,
Oct 7, 2014, 3:58:18 AM10/7/14
to camunda-...@googlegroups.com, markus...@gmail.com, ia.sre...@gmail.com
Thanks, we will fix it for the final release.

Daniel
Reply all
Reply to author
Forward
0 new messages