{"record":{"id":"6eb33f21a8769070","repo":"flowable/flowable-engine","slug":"org-flowable-cdi-impl-processvariablemap-clear-i","errorCode":null,"errorMessage":"org.flowable.cdi.impl.ProcessVariableMap.clear() is not supported.","messagePattern":"org\\.flowable\\.cdi\\.impl\\.ProcessVariableMap\\.clear\\(\\) 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":87,"sourceCode":"\r\n    @Override\r\n    public boolean containsKey(Object key) {\r\n        throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + \".containsKey() is not supported.\");\r\n    }\r\n\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","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cdi/src/main/java/org/flowable/cdi/impl/ProcessVariableMap.java#L69-L105","documentation":"ProcessVariableMap.clear() throws UnsupportedOperationException unconditionally. Bulk-deleting every process variable is not a safe or supported operation through this view; there is no way to enumerate variables, and clearing all variables of a process would be destructive.","triggerScenarios":"Calling clear() directly, or indirectly from helpers that reset maps between uses (test fixtures, pooled contexts, framework reset hooks).","commonSituations":"Test teardown code resetting CDI state; generic code that clears any Map before reuse.","solutions":["Remove variables individually with put(name, null) for the ones you own.","Let the process engine manage variable lifetime (they are removed with the execution/task).","Never pass this map into reset/cleanup utilities expecting Map.clear()."],"exampleFix":"// before\nprocessVariableMap.clear();\n\n// after\nprocessVariableMap.put(\"tempVar\", null);\nprocessVariableMap.put(\"otherTempVar\", null); // clear only variables you explicitly set","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { processVariableMap.clear(); } catch (UnsupportedOperationException e) { /* remove variables individually with put(name, null) */ }","preventionTips":["Never use bulk-reset utilities on ProcessVariableMap","Remove only the variables your code set","Rely on the process engine to clean up variables with the execution"],"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-14T11:17:12.474Z"}