-
Bug Report
-
Resolution: None
-
L3 - Default
-
None
-
7.16.0
-
None
Environment:
Camunda 7.16.0 on Spring Boot
Description:
For various reasons, we sometimes want to lookup what the enum display values were for an earlier completed task. We have a small bit of Java code to do that, using a HistoricTaskInstanceQuery and FormService getTaskFormData
On some workflows, this works just fine. On other workflows, this blows up with a NullValueException from deep in Camunda
When it fails, the we find the HistoricTaskInstance fine, but when we pass that Task ID to FormService.getTaskFormData it fails with an exception like:
org.camunda.bpm.engine.exception.NullValueException: No task found for taskId '5a8fac56-52c6-11ec-9d2b-024255e0ca3a': task is null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:398)
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:55)
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:50)
at org.camunda.bpm.engine.impl.cmd.GetTaskFormCmd.execute(GetTaskFormCmd.java:47)
at org.camunda.bpm.engine.impl.cmd.GetTaskFormCmd.execute(GetTaskFormCmd.java:35)
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.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:72)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:70)
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.getTaskFormData(FormServiceImpl.java:67)
at org.camunda.bpm.engine.FormService$getTaskFormData.call(Unknown Source)
On another workflow, the same code will work just fine. It does seem to be something about some of our workflows seemingly triggering some odd state in Camunda
Steps to reproduce (Required on creation):
Attached is a cut down version of one of our workflows, with the Java code cut down and inlined as a Groovy script. When the workflow tries to transition to the Script task, it will find the historic task, then fail with NullValueException when fetching the form
If it helps, we have a very similar looking workflow with exactly the same code, which works just fine looking up the TaskFormData
Observed Behavior:
org.camunda.bpm.engine.exception.NullValueException: No task found for taskId '.....': task is null
Expected behavior:
TaskFormData correctly returned without exception
Hi NickBurch,
Thank you for raising this bug report.
I'll have a look probably at the beginning of 2022. Stay tuned!
Best,
Tassilo