You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Camunda BPM version: 7.19.0 with spring boot camunda starter
JDK version: 11
Operating system: Windows
Complete executable reproducer: organization repo
Steps: (what exactly are you doing with the above reproducer?)
I have following: public static final VariableFactory<Map<String, StorageFile>> DOCUMENTS = mapVariable(DOCUMENTS_KEY, String.class, StorageFile.class);
via Spring boot rest endpoint following get executed:
public ResponseEntity<String> addFileToRequest(@RequestHeader("X-Tenant-ID") String gp, @PathVariable String reqId, @RequestBody StorageFile storageFile) {
var pi = runtimeService.createProcessInstanceQuery().processInstanceBusinessKey(reqId).singleResult();
securityService.checkBusinessPartner(pi, gp);
log.debug("Found " + pi.getId() + " ProcessInstance for BusinessKey " + reqId);
VariableReader reader = CamundaBpmData.reader(runtimeService, pi.getId());
var linkedfiles = reader.getOrDefault(ProcessVariables.DOCUMENTS, new HashMap<>());
var status = reader.get(ProcessVariables.STATUS);
...
linkedfiles.put(storageFile.getUuid(), storageFile);
VariableWriter<?> writer = CamundaBpmData.writer(runtimeService, pi.getId());
writer.set(ProcessVariables.DOCUMENTS, linkedfiles);
}
and the failing reader running as Spring @org.springframework.scheduling.annotation.Scheduled:
List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().processDefinitionKey("document-request").active().orderByProcessInstanceId().desc().list();
log.debug("found {} active process-request instances", processInstances.size());
for (ProcessInstance pi : processInstances) {
VariableReader variableReader = reader(runtimeService, pi.getId());
...
var documents = variableReader.getOrDefault(ProcessVariables.DOCUMENTS, new HashMap<>());
Expected behaviour
In Camunda should the value of documents from Map<String, StorageFile> type
Actual behaviour
In Camunda Cockpit the Type (Value) of documents is Map<Object, Object> with the saved StorageFIle data and the reader() will fail with Error reading documents: Wrong map type detected, expected Map<java.lang.String,my.package.StorageFile, but was not found in {78c33e4d-351d-449e-9932-d752d964f2ab={filename=dummy.pdf, size=1, owner=Name, uuid=78c33e4d-351d-449e-9932-d752d964f2ab, status=UPLOAD}}
(In case of exceptions provide full stack trace)
io.holunda.camunda.bpm.data.adapter.WrongVariableTypeException: Error reading documents: Wrong map type detected, expected Map<java.lang.String,my.package.StorageFile, but was not found in {78c33e4d-351d-449e-9932-d752d964f2ab={filename=dummy.pdf, size=1, owner=Name, uuid=78c33e4d-351d-449e-9932-d752d964f2ab, status=UPLOAD}} at io.holunda.camunda.bpm.data.adapter.map.AbstractMapReadWriteAdapter.getOrNull(AbstractMapReadWriteAdapter.java:63) ~[camunda-bpm-data-1.2.8.jar:na] at io.holunda.camunda.bpm.data.adapter.map.MapReadWriteAdapterRuntimeService.getOptional(MapReadWriteAdapterRuntimeService.java:37) ~[camunda-bpm-data-1.2.8.jar:na] at io.holunda.camunda.bpm.data.reader.RuntimeServiceVariableReader.getOptional(RuntimeServiceVariableReader.java:32) ~[camunda-bpm-data-1.2.8.jar:na] at io.holunda.camunda.bpm.data.reader.VariableReader.getOrDefault(VariableReader.java:72) ~[camunda-bpm-data-1.2.8.jar:na] at my.package.DocumentsStatusUpdateService.updateDocumentsStatus(DocumentsStatusUpdateService.java:56) ~[classes/:na] at jdk.internal.reflect.GeneratedMethodAccessor117.invoke(Unknown Source) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.27.jar:5.3.27] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na] at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
The text was updated successfully, but these errors were encountered:
Steps to reproduce
I have following:
public static final VariableFactory<Map<String, StorageFile>> DOCUMENTS = mapVariable(DOCUMENTS_KEY, String.class, StorageFile.class);
via Spring boot rest endpoint following get executed:
and the failing reader running as Spring @org.springframework.scheduling.annotation.Scheduled:
Expected behaviour
In Camunda should the value of documents from Map<String, StorageFile> type
Actual behaviour
In Camunda Cockpit the Type (Value) of documents is Map<Object, Object> with the saved StorageFIle data and the reader() will fail with
Error reading documents: Wrong map type detected, expected Map<java.lang.String,my.package.StorageFile, but was not found in {78c33e4d-351d-449e-9932-d752d964f2ab={filename=dummy.pdf, size=1, owner=Name, uuid=78c33e4d-351d-449e-9932-d752d964f2ab, status=UPLOAD}}
(In case of exceptions provide full stack trace)
io.holunda.camunda.bpm.data.adapter.WrongVariableTypeException: Error reading documents: Wrong map type detected, expected Map<java.lang.String,my.package.StorageFile, but was not found in {78c33e4d-351d-449e-9932-d752d964f2ab={filename=dummy.pdf, size=1, owner=Name, uuid=78c33e4d-351d-449e-9932-d752d964f2ab, status=UPLOAD}} at io.holunda.camunda.bpm.data.adapter.map.AbstractMapReadWriteAdapter.getOrNull(AbstractMapReadWriteAdapter.java:63) ~[camunda-bpm-data-1.2.8.jar:na] at io.holunda.camunda.bpm.data.adapter.map.MapReadWriteAdapterRuntimeService.getOptional(MapReadWriteAdapterRuntimeService.java:37) ~[camunda-bpm-data-1.2.8.jar:na] at io.holunda.camunda.bpm.data.reader.RuntimeServiceVariableReader.getOptional(RuntimeServiceVariableReader.java:32) ~[camunda-bpm-data-1.2.8.jar:na] at io.holunda.camunda.bpm.data.reader.VariableReader.getOrDefault(VariableReader.java:72) ~[camunda-bpm-data-1.2.8.jar:na] at my.package.DocumentsStatusUpdateService.updateDocumentsStatus(DocumentsStatusUpdateService.java:56) ~[classes/:na] at jdk.internal.reflect.GeneratedMethodAccessor117.invoke(Unknown Source) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.27.jar:5.3.27] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.27.jar:5.3.27] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na] at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
The text was updated successfully, but these errors were encountered: