{"record":{"id":"0a1347917f1c0016","repo":"flowable/flowable-engine","slug":"org-flowable-cdi-impl-processvariablemap-keyset","errorCode":null,"errorMessage":"org.flowable.cdi.impl.ProcessVariableMap.keySet() is not supported.","messagePattern":"org\\.flowable\\.cdi\\.impl\\.ProcessVariableMap\\.keySet\\(\\) 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":92,"sourceCode":"\r\n    @Override\r\n    public boolean containsValue(Object value) {\r\n        throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + \".containsValue() is not supported.\");\r\n    }\r\n\r\n    @Override\r\n    public Object remove(Object key) {\r\n        throw new UnsupportedOperationException(\"ProcessVariableMap.remove is unsupported. Use ProcessVariableMap.put(key, null)\");\r\n    }\r\n\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":74,"sourceCodeEnd":106,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cdi/src/main/java/org/flowable/cdi/impl/ProcessVariableMap.java#L74-L106","documentation":"ProcessVariableMap.keySet() throws UnsupportedOperationException unconditionally. The map view has no listing capability; variable names can only be obtained through the process engine's variable query APIs.","triggerScenarios":"Calling keySet() directly, iterating the map in a for-each over keys, or calling code such as Map copy constructors, logging of keys, or key-based serialization that invokes keySet().","commonSituations":"Dumping all process variables for debugging; copying variables into another map; frameworks that enumerate Map keys for binding/serialization.","solutions":["Use the process engine API (e.g. VariableScope.getVariableNames() or runtime/task variable queries) to list variable names.","Track your own variable names in a plain collection if you need iteration.","Avoid generic Map iteration over this CDI map."],"exampleFix":"// before\nfor (String name : processVariableMap.keySet()) { ... }\n\n// after\nfor (String name : execution.getVariableNames()) { ... } // use the engine's VariableScope API","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { names = processVariableMap.keySet(); } catch (UnsupportedOperationException e) { names = execution.getVariableNames(); /* engine API */ }","preventionTips":["Do not iterate ProcessVariableMap in for-each loops","Use VariableScope.getVariableNames() or engine queries for listings","Avoid Map-copy constructors on this map"],"tags":["java","cdi","unsupported-operation","map"],"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"}