{"record":{"id":"20b6b2d7071ec679","repo":"flowable/flowable-engine","slug":"language-is-empty","errorCode":null,"errorMessage":"language is empty","messagePattern":"language 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":148,"sourceCode":"\n    public ScriptEngineManager getScriptEngineManager() {\n        return scriptEngineManager;\n    }\n\n\n    protected class JavaScriptingFlowableScriptEvaluationRequest implements FlowableScriptEvaluationRequest {\n\n        protected String language;\n        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;","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/scripting/JSR223FlowableScriptEngine.java#L130-L166","documentation":"The builder method FlowableScriptEvaluationRequest.language(String) validates its argument and throws FlowableIllegalArgumentException when the language string is null or empty. This is an eager fail-fast check so an invalid request is rejected before any engine lookup happens.","triggerScenarios":"Calling new FlowableScriptEvaluationRequest().language(null) or language(\"\") — typically when the language is read from a variable, config property, or BPMN attribute that is unset.","commonSituations":"A script task's language attribute omitted or empty in the process XML; a config property placeholder that did not resolve; dynamic language selection code passing an empty string.","solutions":["Pass a non-empty engine name, e.g. language(\"javascript\") or language(\"groovy\").","Validate/resolve the source of the language value (BPMN attribute, property) before building the request.","Apply a default language when the input is blank."],"exampleFix":"// before\nrequest.language(config.get(\"script.language\"));\n\n// after\nString lang = config.getOrDefault(\"script.language\", \"javascript\");\nif (lang == null || lang.isEmpty()) throw new IllegalStateException(\"script.language must be set\");\nrequest.language(lang);","handlingStrategy":"validation","validationCode":"if (language == null || language.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"language must be a non-empty engine name\");\n}","typeGuard":"boolean hasLanguage(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    request.language(lang);\n} catch (FlowableIllegalArgumentException e) {\n    throw new ConfigurationException(\"Script language not set; check BPMN attribute or config\", e);\n}","preventionTips":["Centralize engine names in constants instead of ad-hoc strings.","Provide a default language fallback when the source value is blank.","Validate configuration at startup, not at script execution time."],"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"}