{"record":{"id":"9fba88beb1da07c1","repo":"flowable/flowable-engine","slug":"unsupported-flow-element-type-flowelement-in","errorCode":null,"errorMessage":"Unsupported flow element type + flowElement + in + execution","messagePattern":"Unsupported flow element type \\+ flowElement \\+ in \\+ execution","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/WebServiceActivityBehavior.java","lineNumber":108,"sourceCode":"        IOSpecification ioSpecification = null;\n        String operationRef = null;\n        List<DataAssociation> dataInputAssociations = null;\n        List<DataAssociation> dataOutputAssociations = null;\n\n        if (flowElement instanceof SendTask sendTask) {\n            ioSpecification = sendTask.getIoSpecification();\n            operationRef = sendTask.getOperationRef();\n            dataInputAssociations = sendTask.getDataInputAssociations();\n            dataOutputAssociations = sendTask.getDataOutputAssociations();\n\n        } else if (flowElement instanceof ServiceTask serviceTask) {\n            ioSpecification = serviceTask.getIoSpecification();\n            operationRef = serviceTask.getOperationRef();\n            dataInputAssociations = serviceTask.getDataInputAssociations();\n            dataOutputAssociations = serviceTask.getDataOutputAssociations();\n\n        } else {\n            throw new FlowableException(\"Unsupported flow element type \" + flowElement + \" in \" + execution);\n        }\n\n        MessageInstance message = null;\n\n        Operation operation = operationMap.get(operationRef);\n\n        try {\n\n            if (ioSpecification != null) {\n                initializeIoSpecification(ioSpecification, execution, bpmnModel);\n                if (ioSpecification.getDataInputRefs().size() > 0) {\n                    String firstDataInputName = ioSpecification.getDataInputRefs().get(0);\n                    ItemInstance inputItem = (ItemInstance) execution.getTransientVariable(firstDataInputName);\n                    message = new MessageInstance(operation.getInMessage(), inputItem);\n                }\n\n            } else {\n                message = operation.getInMessage().createInstance();","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/WebServiceActivityBehavior.java#L90-L126","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Ensure only SendTask/ServiceTask elements get WebServiceActivityBehavior (check custom ActivityBehaviorFactory/parse handlers)","Verify the deployed BPMN element type matches the intended web-service activity","Check execution.getCurrentFlowElement() type before invoking the behavior in custom code","Redeploy a clean process definition if the model was generated programmatically"],"exampleFix":"// before\nscriptTask.setBehavior(new WebServiceActivityBehavior());\n// after\nserviceTask.setBehavior(new WebServiceActivityBehavior());","handlingStrategy":"type-guard","validationCode":"FlowElement fe = execution.getCurrentFlowElement();\nif (!(fe instanceof ServiceTask) && !(fe instanceof SendTask)) {\n    throw new IllegalStateException(\"WebService behavior requires ServiceTask/SendTask, got \" + fe.getClass());\n}","typeGuard":"boolean isWebServiceElement(FlowElement fe) {\n    return fe instanceof ServiceTask || fe instanceof SendTask;\n}","tryCatchPattern":"try {\n    webServiceBehavior.execute(execution);\n} catch (FlowableException e) {\n    logger.error(\"WS activity element type unsupported\", e);\n}","preventionTips":["Attach WebServiceActivityBehavior only to SendTask/ServiceTask","Avoid custom behavior assignments that bypass the BehaviorFactory","Validate the generated BPMN model before deployment","Test WS tasks after engine upgrades with custom parse handlers"],"tags":["web-service","service-task","type-mismatch","bpmn"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}