{"record":{"id":"ff81abe373b3df50","repo":"flowable/flowable-engine","slug":"unsupported-flow-element-type-s","errorCode":null,"errorMessage":"Unsupported flow element type %s","messagePattern":"Unsupported flow element type (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/WebServiceActivityBehavior.java","lineNumber":111,"sourceCode":"        List<DataAssociation> dataInputAssociations = null;\n        List<DataAssociation> dataOutputAssociations = null;\n\n        if (flowElement instanceof SendTask) {\n            SendTask sendTask = (SendTask) flowElement;\n            ioSpecification = sendTask.getIoSpecification();\n            operationRef = sendTask.getOperationRef();\n            dataInputAssociations = sendTask.getDataInputAssociations();\n            dataOutputAssociations = sendTask.getDataOutputAssociations();\n\n        } else if (flowElement instanceof ServiceTask) {\n            ServiceTask serviceTask = (ServiceTask) flowElement;\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);\n        }\n\n        MessageInstance message = null;\n\n        Operation operation = operationMap.get(operationRef);\n        try {\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();\n            }\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/WebServiceActivityBehavior.java#L93-L129","documentation":"Thrown in WebServiceActivityBehavior.execute() when the activity's flow element is neither a SendTask nor a ServiceTask with the expected web-service properties (ioSpecification, operationRef, data associations). Only those element types can invoke a web service; any other element routed to this behavior is unsupported.","triggerScenarios":"A BPMN element (e.g. a custom task or misconfigured activity) whose behavior is set to WebServiceActivityBehavior but whose Bpmn flowElement is not a SendTask/ServiceTask; programmatic model corruption where the behavior/element pairing is wrong.","commonSituations":"Custom task types reusing the web service behavior class; a broken/patched BPMN model where behavior was assigned manually; copy-pasted XML merging attributes across task types.","solutions":["Use a <serviceTask> (with webservice implementation) or <sendTask> element in the BPMN XML instead of another task type","Verify the element's implementation/behavior mapping — do not attach WebServiceActivityBehavior to other flow elements","Regenerate/repair the deployed BPMN model if it was programmatically modified","Check custom BpmnParseHandler code that may assign the wrong behavior class to the element"],"exampleFix":"<!-- before -->\n<task id=\"wsCall\" activiti:expression=\"${webServiceActivityBehavior}\">\n<!-- after -->\n<serviceTask id=\"wsCall\" activiti:implementation=\"##WebService\" activiti:operationRef=\"tns:myOperation\">","handlingStrategy":"validation","validationCode":"if (!(flowElement instanceof ServiceTask) && !(flowElement instanceof SendTask)) {\n    throw new IllegalArgumentException(\"WebServiceActivityBehavior only supports ServiceTask/SendTask, got \" + flowElement.getClass());\n}","typeGuard":"boolean isWebServiceTask(FlowElement e) { return e instanceof ServiceTask || e instanceof SendTask; }","tryCatchPattern":"try {\n    deploymentBuilder.deploy();\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Unsupported flow element type\")) { /* fix BPMN element type */ }\n    throw e;\n}","preventionTips":["Only attach web service behavior to <serviceTask>/<sendTask> elements","Do not register WebServiceActivityBehavior for custom task types","Review custom BpmnParseHandler behavior mappings"],"tags":["web-service","service-task","bpmn","unsupported-element"],"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"}