flowable/flowable-engine · error · FlowableException
variableListenerEventDefinition is only supported for events
Error message
variableListenerEventDefinition is only supported for events, not for activity id ${parentElement.getId()} What it means
The converter maps a variableListenerEventDefinition child element to an event definition, but this definition is only meaningful on event elements (catch/intermediate/boundary events). If the parent activity is a task, service task, etc., Flowable throws a FlowableException naming the offending activity id.
Source
Thrown at modules/flowable-bpmn-converter/src/main/java/org/flowable/bpmn/converter/child/VariableListenerEventDefinitionParser.java:38
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.Event;
import org.flowable.bpmn.model.VariableListenerEventDefinition;
import org.flowable.common.engine.api.FlowableException;
/**
* @author Tijs Rademakers
*/
public class VariableListenerEventDefinitionParser extends BaseChildElementParser {
@Override
public String getElementName() {
return ELEMENT_EVENT_VARIABLELISTENERDEFINITION;
}
@Override
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (!(parentElement instanceof Event event)) {
throw new FlowableException("variableListenerEventDefinition is only supported for events, not for activity id " + parentElement.getId());
}
VariableListenerEventDefinition eventDefinition = new VariableListenerEventDefinition();
BpmnXMLUtil.addXMLLocation(eventDefinition, xtr);
String variableName = xtr.getAttributeValue(null, ATTRIBUTE_VARIABLE_NAME);
if (StringUtils.isEmpty(variableName)) {
LOGGER.warn("variable name is required for variable listener with activity id {}", parentElement.getId());
}
eventDefinition.setVariableName(variableName);
String variableChangeType = xtr.getAttributeValue(null, ATTRIBUTE_VARIABLE_CHANGE_TYPE);
eventDefinition.setVariableChangeType(variableChangeType);
event.addEventDefinition(eventDefinition);
model.addActivityIdForVariableListenerName(variableName, parentElement.getId());
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Move the variableListenerEventDefinition into an event element (e.g. intermediateCatchEvent) that references the same activity id
- Remove the variableListenerEventDefinition from the non-event element
- Redeploy the corrected BPMN XML
Example fix
<!-- before --> <serviceTask id="task1"> <flowable:variableListenerEventDefinition variableName="v"/> </serviceTask> <!-- after --> <intermediateCatchEvent id="evt1"> <flowable:variableListenerEventDefinition variableName="v"/> </intermediateCatchEvent>
Defensive patterns
Strategy: try-catch
Try / catch
try { bpmnXMLConverter.convertToBpmnModel(xmlInput); } catch (FlowableException e) { /* move event definition into an Event element */ } Prevention
- Place variableListenerEventDefinition only under Event elements
When it happens
Trigger: BPMN XML places <flowable:variableListenerEventDefinition> inside a non-event activity (e.g. a serviceTask or userTask) instead of an intermediateCatchEvent or boundaryEvent.
Common situations: Hand-edited XML moving event definitions between elements; refactoring a task into an event but forgetting to move the child definition; modeler exports with misplaced children.
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
- '${andChildren}' is not valid boolean in mapException with e
- No errorCode defined mapException with errorCode=${errorCode
- Could not resolve key for: ${eventDefinitionKey} for ${execu
- BPMN XSD could not be found
- The bpmn 2.0 xml is not properly encoded
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/81fd563db72b118d.
Report an issue: GitHub.