{"record":{"id":"c7cef81668f4f169","repo":"flowable/flowable-engine","slug":"no-script-provided-for-scripttask","errorCode":null,"errorMessage":"No script provided for scriptTask {}","messagePattern":"No script provided for scriptTask (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-secure-javascript/src/main/java/org/flowable/scripting/secure/behavior/SecureJavascriptTaskParseHandler.java","lineNumber":44,"sourceCode":"\n    private static final Logger LOGGER = LoggerFactory.getLogger(SecureJavascriptTaskParseHandler.class);\n\n    public static final String LANGUAGE_JAVASCRIPT = \"javascript\";\n\n    @Override\n    protected void executeParse(BpmnParse bpmnParse, ScriptTask scriptTask) {\n        String language = scriptTask.getScriptFormat();\n        if (LANGUAGE_JAVASCRIPT.equalsIgnoreCase(language)) {\n            createSecureJavascriptTaskBehavior(bpmnParse, scriptTask, language);\n        } else {\n            super.executeParse(bpmnParse, scriptTask);\n        }\n    }\n\n    protected void createSecureJavascriptTaskBehavior(BpmnParse bpmnParse, ScriptTask scriptTask,\n        String language) {\n        if (StringUtils.isEmpty(scriptTask.getScript())) {\n            LOGGER.warn(\"No script provided for scriptTask {}\", scriptTask.getId());\n        }\n\n        scriptTask.setBehavior(new SecureJavascriptTaskActivityBehavior(scriptTask.getId(),\n            scriptTask.getScript(), language, scriptTask.getResultVariable(),\n            scriptTask.getSkipExpression(), scriptTask.isAutoStoreVariables()));\n    }\n\n}\n","sourceCodeStart":26,"sourceCodeEnd":53,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-secure-javascript/src/main/java/org/flowable/scripting/secure/behavior/SecureJavascriptTaskParseHandler.java#L26-L53","documentation":"When parsing a scriptTask configured with the secure JavaScript behavior, the parser checks the script body. If the script attribute is empty or missing, it logs this warning; the behavior is still attached but will have a null script and fail at runtime when the task executes.","triggerScenarios":"BPMN XML containing <serviceTask>/<scriptTask> with flowable:delegateExpression or the secure Javascript handler and no (or empty) <script> child element or script attribute; createSecureJavascriptTaskBehavior invoked during BpmnParse.executeParse.","commonSituations":"Hand-edited BPMN where the script element was deleted; modeler exporting a script task with empty script field; dynamically generated process XML where the script variable was null at build time.","solutions":["Add the <flowable:script> child element (or script attribute) with a non-empty script body to the scriptTask in the BPMN XML.","If the script is supplied at runtime, verify the variable/expression that populates it resolves to a non-empty string.","Fix the process model in the designer before deploying so the task has script content.","If an empty script is intentional, replace the scriptTask with a different service task type (e.g. delegateExpression)."],"exampleFix":"// before\n<serviceTask id=\"task1\" flowable:type=\"javascript\"/>\n// after\n<serviceTask id=\"task1\" flowable:type=\"javascript\">\n  <extensionElements>\n    <flowable:script><![CDATA[ return 1 + 1; ]]></flowable:script>\n  </extensionElements>\n</serviceTask>","handlingStrategy":"validation","validationCode":"function validateBpmn(xml) {\n  const doc = new DOMParser().parseFromString(xml, 'application/xml');\n  const tasks = doc.getElementsByTagNameNS('*', 'scriptTask');\n  for (const t of tasks) {\n    const scripts = t.getElementsByTagNameNS('*', 'script');\n    if (!scripts.length || !scripts[0].textContent.trim()) {\n      throw new Error('scriptTask ' + t.getAttribute('id') + ' has no script');\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate BPMN models against the Flowable XSD before deployment.","In generated processes, assert the script string is non-empty before XML assembly.","Add a unit test that deploys every process resource and asserts no warnings."],"tags":["bpmn","script-task","validation","deployment"],"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-14T11:17:12.474Z"}