{"record":{"id":"6dffeca599bf4654","repo":"flowable/flowable-engine","slug":"one-of-the-attributes-class-delegateexpression","errorCode":null,"errorMessage":"One of the attributes 'class', 'delegateExpression', 'type', 'operation', or 'expression' is mandatory on serviceTask {}","messagePattern":"One of the attributes 'class', 'delegateExpression', 'type', 'operation', or 'expression' is mandatory on serviceTask (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/ServiceTaskParseHandler.java","lineNumber":82,"sourceCode":"            activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createClassDelegateServiceTask(serviceTask));\n\n            // activiti:delegateExpression\n        } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) {\n            activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createServiceTaskDelegateExpressionActivityBehavior(serviceTask));\n\n            // activiti:expression\n        } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) {\n            activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createServiceTaskExpressionActivityBehavior(serviceTask));\n\n            // Webservice\n        } else if (ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(serviceTask.getImplementationType()) &&\n                StringUtils.isNotEmpty(serviceTask.getOperationRef())) {\n\n            WebServiceActivityBehavior webServiceActivityBehavior = bpmnParse.getActivityBehaviorFactory().createWebServiceActivityBehavior(serviceTask, bpmnParse.getBpmnModel());\n            activity.setActivityBehavior(webServiceActivityBehavior);\n\n        } else {\n            LOGGER.warn(\"One of the attributes 'class', 'delegateExpression', 'type', 'operation', or 'expression' is mandatory on serviceTask {}\", serviceTask.getId());\n        }\n\n    }\n}\n","sourceCodeStart":64,"sourceCodeEnd":87,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/ServiceTaskParseHandler.java#L64-L87","documentation":"A serviceTask element defines none of the required implementation attributes: activiti:class, delegateExpression, expression, a known 'type', or an operationRef for web service. The parser logs this warning and leaves the activity without a behavior; invoking the task at runtime will fail because there is nothing to execute.","triggerScenarios":"executeParse of a ServiceTask reaching the final else branch: implementationType not CLASS/EXPRESSION/DELEGATEEXPRESSION/WEBSERVICE/type-branch — typically an empty <serviceTask id=\"x\"/> or one with only unrelated attributes.","commonSituations":"Bare serviceTask shape dropped from a palette and never configured; import from external tooling using different attribute names; accidental removal of the class attribute during refactoring.","solutions":["Add one of the required attributes, e.g. flowable:class=\"com.x.MyDelegate\" or flowable:delegateExpression=\"${bean}\"","Set a known flowable:type (mail, camel, shell, ...) or flowable:expression=\"${...}\"","Provide operationRef plus WSDL imports for a web-service task"],"exampleFix":"// before\n<serviceTask id=\"st1\" name=\"Do work\"/>\n// after\n<serviceTask id=\"st1\" name=\"Do work\" flowable:class=\"com.example.WorkDelegate\"/>","handlingStrategy":"validation","validationCode":"for (ServiceTask t : model.getFlowElementsOfType(ServiceTask.class)) {\n    boolean hasImpl = notEmpty(t.getImplementation()) || notEmpty(t.getType()) || notEmpty(t.getOperationRef());\n    if (!hasImpl) throw new IllegalArgumentException(\"serviceTask \" + t.getId() + \" has no implementation\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never deploy serviceTask shapes without an implementation attribute","Validate the BPMN in CI before repository deployment","Standardize on class or delegateExpression implementations in team conventions"],"tags":["bpmn","parsing","service-task","missing-attribute"],"backgroundTag":"missing-required-argument","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"}