Details
-
Bug Report
-
Status: Closed
-
L3 - Default
-
Resolution: Fixed
-
7.9.5, 7.8.12, 7.10.0-alpha5
-
None
Description
Scenario:
Multiple executions exist during the attachment creation for a process instance.
Example API call:
TaskService taskService = processEngine.getTaskService();
taskService.createAttachment(uploadContentType, null, processInstanceId, uploadFileName, description, fileInputStream);
Current behavior:
An exception is thrown:
org.camunda.bpm.engine.ProcessEngineException: processInstances does not have 1 elements at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181] at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:344) ~[camunda-engine-7.8.0.jar:7.8.0] at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNumberOfElements(EnsureUtil.java:311) ~[camunda-engine-7.8.0.jar:7.8.0] at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNumberOfElements(EnsureUtil.java:299) ~[camunda-engine-7.8.0.jar:7.8.0] at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNumberOfElements(EnsureUtil.java:294) ~[camunda-engine-7.8.0.jar:7.8.0] at org.camunda.bpm.engine.impl.cmd.CreateAttachmentCmd.execute(CreateAttachmentCmd.java:74) ~[camunda-engine-7.8.0.jar:7.8.0] at org.camunda.bpm.engine.impl.cmd.CreateAttachmentCmd.execute(CreateAttachmentCmd.java:43) ~[camunda-engine-7.8.0.jar:7.8.0]
Expected behavior:
The attachment is created successfully.
Hints: The exception is caused by the class CreateAttachmentCMD
A workaround is to provide an empty String instead of null as taskId but then the operationLogManager is never called (the task of the taskId is never validated).
mgm-controller-panel
This is the controller panel for Smart Panels app
Attachments
Issue Links
- is related to
-
CAM-10440 TaskServiceTest fails due to missing HistoryLevel check
-
- Closed
-