flowable/flowable-engine · error · UnsupportedOperationException

ProcessVariableMap.remove is unsupported. Use ProcessVariabl

Error message

ProcessVariableMap.remove is unsupported. Use ProcessVariableMap.put(key, null)

What it means

ProcessVariableMap.remove(Object) throws UnsupportedOperationException with an explicit remediation hint: setting a variable to null via put(key, null) is the flowable way to delete a process variable, so removal is expressed as a put instead.

Source

Thrown at modules/flowable-cdi/src/main/java/org/flowable/cdi/impl/ProcessVariableMap.java:82

    @Override
    public boolean isEmpty() {
        throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + ".isEmpty() is not supported.");
    }

    @Override
    public boolean containsKey(Object key) {
        throw new UnsupportedOperationException(ProcessVariableMap.class.getName() + ".containsKey() is not supported.");
    }

    @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

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Replace remove(key) with put(key, null) as the exception message instructs.
  2. If BusinessProcess is accessible directly, call setVariable(key, null) to clear the variable.
  3. Keep this map out of generic Map-mutating utility code.

Example fix

// before
processVariableMap.remove("tempVar");

// after
processVariableMap.put("tempVar", null); // setting to null deletes the process variable
Defensive patterns

Strategy: fallback

Try / catch

try { processVariableMap.remove(name); } catch (UnsupportedOperationException e) { processVariableMap.put(name, null); }

Prevention

When it happens

Trigger: Calling remove(name) directly, or using Map.clear()/retainAll-style helpers, or libraries that delete entries from any Map (e.g. removing processed entries).

Common situations: Cleanup logic after a variable is consumed; generic Map-manipulation utilities; porting code that used a HashMap and relied on remove().

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/5070ca70d6725d3d. Report an issue: GitHub.