{"record":{"id":"7aa75e1ffba2cd08","repo":"flowable/flowable-engine","slug":"org-flowable-cdi-impl-processvariablemap-entryset","errorCode":null,"errorMessage":"org.flowable.cdi.impl.ProcessVariableMap.entrySet() is not supported.","messagePattern":"org\\.flowable\\.cdi\\.impl\\.ProcessVariableMap\\.entrySet\\(\\) is not supported\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cdi/src/main/java/org/flowable/cdi/impl/ProcessVariableMap.java","lineNumber":102,"sourceCode":"\r\n    @Override\r\n    public void clear() {\r\n        throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + \".clear() is not supported.\");\r\n    }\r\n\r\n    @Override\r\n    public Set<String> keySet() {\r\n        throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + \".keySet() is not supported.\");\r\n    }\r\n\r\n    @Override\r\n    public Collection<Object> values() {\r\n        throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + \".values() is not supported.\");\r\n    }\r\n\r\n    @Override\r\n    public Set<Map.Entry<String, Object>> entrySet() {\r\n        throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + \".entrySet() is not supported.\");\r\n    }\r\n\r\n}\r\n","sourceCodeStart":84,"sourceCodeEnd":106,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cdi/src/main/java/org/flowable/cdi/impl/ProcessVariableMap.java#L84-L106","documentation":"ProcessVariableMap is a read-only, map-like view over CDI-resolved process variables in Flowable's CDI integration. It deliberately does not support bulk views such as values() or entrySet(), because process variables live in the engine, not in an in-memory map. Calling entrySet() immediately throws UnsupportedOperationException with this message.","triggerScenarios":"Calling entrySet() (or values(), keySet()-style iteration) on a ProcessVariableMap instance obtained via CDI injection of @ProcessVariable Map<String,Object> or BusinessProcess.getProcessVariables()-style map access.","commonSituations":"Developers treat the injected process-variable map like a normal HashMap and try to iterate entries, stream over entrySet(), or copy it with new HashMap<>(processVariableMap), or log it via toString-based debugging that touches entrySet.","solutions":["Do not iterate the map directly; look up individual variables with get(name) instead.","Use the Flowable API to enumerate variables: runtimeService.getVariables(executionId) or taskService.getVariables(taskId), which return a real Map.","If you need a snapshot map, fetch variables via the engine services and copy that result, not the CDI ProcessVariableMap."],"exampleFix":"// before\nfor (Map.Entry<String, Object> e : processVariables.entrySet()) { ... }\n// after\nMap<String, Object> vars = runtimeService.getVariables(executionId);\nfor (Map.Entry<String, Object> e : vars.entrySet()) { ... }","handlingStrategy":"type-guard","validationCode":"if (map instanceof ProcessVariableMap) { /* entrySet unsupported */ }","typeGuard":"boolean isIterable(Map<String,Object> m) { return !(m instanceof org.flowable.cdi.impl.ProcessVariableMap); }","tryCatchPattern":"try { map.entrySet().iterator(); } catch (UnsupportedOperationException e) { /* fall back to engine variable query */ }","preventionTips":["Never iterate CDI process-variable maps directly; fetch via RuntimeService/TaskService for enumeration","When writing generic Map-consuming code, exclude engine-backed map views"],"tags":["cdi","unsupported-operation","process-variables"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}