flowable/flowable-engine · error · UnsupportedOperationException
org.flowable.cdi.impl.ProcessVariableMap.keySet() is not…
Error message
org.flowable.cdi.impl.ProcessVariableMap.keySet() is not supported.
What it means
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.
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.
Example fix
// before
for (String name : processVariableMap.keySet()) { ... }
// after
for (String name : execution.getVariableNames()) { ... } // use the engine's VariableScope API Defensive patterns
Strategy: try-catch
Try / catch
try { names = processVariableMap.keySet(); } catch (UnsupportedOperationException e) { names = execution.getVariableNames(); /* engine API */ } Prevention
- Do not iterate ProcessVariableMap in for-each loops
- Use VariableScope.getVariableNames() or engine queries for listings
- Avoid Map-copy constructors on this map
When it happens
Trigger: 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().
Common situations: Dumping all process variables for debugging; copying variables into another map; frameworks that enumerate Map keys for binding/serialization.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- org.flowable.cdi.impl.ProcessVariableMap.clear() is not…
- org.flowable.cdi.impl.ProcessVariableMap.containsKey() is…
- org.flowable.cdi.impl.ProcessVariableMap.containsValue() is…
- org.flowable.cdi.impl.ProcessVariableMap.isEmpty() is not…
- org.flowable.cdi.impl.ProcessVariableMap.size() is not…
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/0a1347917f1c0016.
Report an issue: GitHub.
Appendix: source
Thrown at modules/flowable-cdi/src/main/java/org/flowable/cdi/impl/ProcessVariableMap.java:92
@Override
public boolean containsValue(Object value) {
throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + ".containsValue() is not supported.");
}
@Override
public Object remove(Object key) {
throw new UnsupportedOperationException("ProcessVariableMap.remove is unsupported. Use ProcessVariableMap.put(key, null)");
}
@Override
public void clear() {
throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + ".clear() is not supported.");
}
@Override
public Set<String> keySet() {
throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + ".keySet() is not supported.");
}
@Override
public Collection<Object> values() {
throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + ".values() is not supported.");
}
@Override
public Set<Map.Entry<String, Object>> entrySet() {
throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + ".entrySet() is not supported.");
}
}
View on GitHub (pinned to d6d39ce1c6)