{"record":{"id":"6e067a69f0644eb8","repo":"flowable/flowable-engine","slug":"no-script-provided-for-scripttask-6e067a","errorCode":null,"errorMessage":"No script provided for scriptTask {}","messagePattern":"No script provided for scriptTask (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/ScriptTaskParseHandler.java","lineNumber":40,"sourceCode":"import org.slf4j.LoggerFactory;\n\n/**\n * @author Joram Barrez\n */\npublic class ScriptTaskParseHandler extends AbstractActivityBpmnParseHandler<ScriptTask> {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(ScriptTaskParseHandler.class);\n\n    @Override\n    public Class<? extends BaseElement> getHandledType() {\n        return ScriptTask.class;\n    }\n\n    @Override\n    protected void executeParse(BpmnParse bpmnParse, ScriptTask scriptTask) {\n\n        if (StringUtils.isEmpty(scriptTask.getScript())) {\n            LOGGER.warn(\"No script provided for scriptTask {}\", scriptTask.getId());\n        }\n\n        ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, scriptTask, BpmnXMLConstants.ELEMENT_TASK_SCRIPT);\n\n        activity.setAsync(scriptTask.isAsynchronous());\n        activity.setExclusive(!scriptTask.isNotExclusive());\n\n        activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createScriptTaskActivityBehavior(scriptTask));\n\n    }\n\n}\n","sourceCodeStart":22,"sourceCodeEnd":53,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/ScriptTaskParseHandler.java#L22-L53","documentation":"A scriptTask element in the BPMN XML has an empty or missing script. The parser logs this warning (the deployment still proceeds) and the task will have no script to execute, failing at runtime if the behavior is invoked. This catches models where the script body was never entered or was lost.","triggerScenarios":"executeParse of a ScriptTask where StringUtils.isEmpty(scriptTask.getScript()) — i.e. the <scriptTask> has no inner script text, possibly with a language set but no body.","commonSituations":"Modeler export dropping script CDATA content; copying a scriptTask skeleton and forgetting to paste the script; template generation leaving the script placeholder empty.","solutions":["Add the script text as the content of the scriptTask element in the BPMN XML","Provide the script programmatically before deployment if the model is generated","Remove the scriptTask or replace it with another task type if no script is needed"],"exampleFix":"// before\n<scriptTask id=\"s1\" scriptFormat=\"javascript\"/>\n// after\n<scriptTask id=\"s1\" scriptFormat=\"javascript\"><![CDATA[return 1 + 1;]]></scriptTask>","handlingStrategy":"validation","validationCode":"for (ScriptTask t : model.getFlowElementsOfType(ScriptTask.class)) {\n    if (t.getScript() == null || t.getScript().trim().isEmpty()) {\n        throw new IllegalArgumentException(\"scriptTask \" + t.getId() + \" has no script\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fill the script body before exporting/deploying","Use modeler validation to catch empty required fields","Programmatically generate scripts with template checks for placeholders"],"tags":["bpmn","parsing","script-task","empty-field"],"backgroundTag":"empty-required-field","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"}