flowable/flowable-engine · error · FlowableException

Unsupported flow element type + flowElement + in + execution

Error message

Unsupported flow element type + flowElement + in + execution

What it means

WebServiceActivityBehavior.execute supports only SendTask and ServiceTask elements that carry WS (web service) configuration. If the current flow element is any other type, the behavior cannot extract ioSpecification/operation/data associations and throws this FlowableException. It is effectively a programmatic type check against the resolved flow element.

Solutions

  1. Ensure only SendTask/ServiceTask elements get WebServiceActivityBehavior (check custom ActivityBehaviorFactory/parse handlers)
  2. Verify the deployed BPMN element type matches the intended web-service activity
  3. Check execution.getCurrentFlowElement() type before invoking the behavior in custom code
  4. Redeploy a clean process definition if the model was generated programmatically

Example fix

// before
scriptTask.setBehavior(new WebServiceActivityBehavior());
// after
serviceTask.setBehavior(new WebServiceActivityBehavior());
Defensive patterns

Strategy: type-guard

Validate before calling

FlowElement fe = execution.getCurrentFlowElement();
if (!(fe instanceof ServiceTask) && !(fe instanceof SendTask)) {
    throw new IllegalStateException("WebService behavior requires ServiceTask/SendTask, got " + fe.getClass());
}

Type guard

boolean isWebServiceElement(FlowElement fe) {
    return fe instanceof ServiceTask || fe instanceof SendTask;
}

Try / catch

try {
    webServiceBehavior.execute(execution);
} catch (FlowableException e) {
    logger.error("WS activity element type unsupported", e);
}

Prevention

When it happens

Trigger: A WebServiceActivityBehavior instance is executed for a flow element that is neither a SendTask nor a ServiceTask (custom behavior assignment, parse handler mistake, or mis-mapped element).

Common situations: Custom ActivityBehaviorFactory returning the WS behavior for the wrong element type; programmatic model building attaching the behavior to a ScriptTask; engine upgrades with custom parse handlers.

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/9fba88beb1da07c1. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/WebServiceActivityBehavior.java:108

        IOSpecification ioSpecification = null;
        String operationRef = null;
        List<DataAssociation> dataInputAssociations = null;
        List<DataAssociation> dataOutputAssociations = null;

        if (flowElement instanceof SendTask sendTask) {
            ioSpecification = sendTask.getIoSpecification();
            operationRef = sendTask.getOperationRef();
            dataInputAssociations = sendTask.getDataInputAssociations();
            dataOutputAssociations = sendTask.getDataOutputAssociations();

        } else if (flowElement instanceof ServiceTask serviceTask) {
            ioSpecification = serviceTask.getIoSpecification();
            operationRef = serviceTask.getOperationRef();
            dataInputAssociations = serviceTask.getDataInputAssociations();
            dataOutputAssociations = serviceTask.getDataOutputAssociations();

        } else {
            throw new FlowableException("Unsupported flow element type " + flowElement + " in " + execution);
        }

        MessageInstance message = null;

        Operation operation = operationMap.get(operationRef);

        try {

            if (ioSpecification != null) {
                initializeIoSpecification(ioSpecification, execution, bpmnModel);
                if (ioSpecification.getDataInputRefs().size() > 0) {
                    String firstDataInputName = ioSpecification.getDataInputRefs().get(0);
                    ItemInstance inputItem = (ItemInstance) execution.getTransientVariable(firstDataInputName);
                    message = new MessageInstance(operation.getInMessage(), inputItem);
                }

            } else {
                message = operation.getInMessage().createInstance();

View on GitHub (pinned to d6d39ce1c6)