{"record":{"id":"875517995bb02e64","repo":"flowable/flowable-engine","slug":"script-is-empty","errorCode":null,"errorMessage":"script is empty","messagePattern":"script is empty","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/scripting/JSR223FlowableScriptEngine.java","lineNumber":157,"sourceCode":"        protected String script;\n        protected Resolver resolver;\n        protected VariableContainer scopeContainer;\n        protected VariableContainer inputVariableContainer;\n        protected boolean storeScriptVariables;\n\n        @Override\n        public FlowableScriptEvaluationRequest language(String language) {\n            if (StringUtils.isEmpty(language)) {\n                throw new FlowableIllegalArgumentException(\"language is empty\");\n            }\n            this.language = language;\n            return this;\n        }\n\n        @Override\n        public FlowableScriptEvaluationRequest script(String script) {\n            if (StringUtils.isEmpty(script)) {\n                throw new FlowableIllegalArgumentException(\"script is empty\");\n            }\n            this.script = script;\n            return this;\n        }\n\n        @Override\n        public FlowableScriptEvaluationRequest resolver(Resolver resolver) {\n            this.resolver = resolver;\n            return this;\n        }\n\n        @Override\n        public FlowableScriptEvaluationRequest scopeContainer(VariableContainer scopeContainer) {\n            this.scopeContainer = scopeContainer;\n            return this;\n        }\n\n        @Override","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/scripting/JSR223FlowableScriptEngine.java#L139-L175","documentation":"The builder method FlowableScriptEvaluationRequest.script(String) validates its argument and throws FlowableIllegalArgumentException when the script text is null or empty. The engine refuses to evaluate a request with no script body.","triggerScenarios":"Calling request.script(null) or script(\"\") — usually when the script text is loaded from a resource that failed to load, or a BPMN script element has an empty body.","commonSituations":"A classpath resource containing the script was not found and the loader returned an empty string; an empty <flowable:script> element in the process definition; template generation produced an empty script.","solutions":["Pass the actual script text, e.g. script(\"return input;\").","Check the resource/property that supplies the script content and fail earlier with a clear message if blank.","Log the loaded script length before building the request to catch empty loads."],"exampleFix":"// before\nString script = loadScript(path);\nrequest.script(script);\n\n// after\nString script = loadScript(path);\nif (script == null || script.trim().isEmpty()) throw new IllegalStateException(\"Script resource is empty: \" + path);\nrequest.script(script);","handlingStrategy":"validation","validationCode":"if (script == null || script.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"script text must be non-empty (check resource/variable source)\");\n}","typeGuard":"boolean hasScript(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    request.script(scriptText);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ConfigurationException(\"Script content is empty; verify the script source\", e);\n}","preventionTips":["Load scripts from resources with a loader that fails loudly on missing/empty files.","Log script length at debug level before evaluation.","Add unit tests asserting the script resource is non-empty."],"tags":["scripting","validation","empty-string"],"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"}