{"record":{"id":"60af4b068d00c967","repo":"flowable/flowable-engine","slug":"the-field-language-should-be-set-on-getclass","errorCode":null,"errorMessage":"The field 'language' should be set on \" + getClass().getSimpleName()","messagePattern":"The field 'language' should be set on \" \\+ getClass\\(\\)\\.getSimpleName\\(\\)","errorType":"exception","errorClass":"FlowableIllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/scripting/AbstractScriptEvaluator.java","lineNumber":103,"sourceCode":"            String resultVariable = Objects.toString(this.resultVariable.getValue(variableContainer), null);\n            if (variableContainer != null && resultVariable != null) {\n                variableContainer.setVariable(resultVariable, result);\n            }\n        }\n        return result;\n    }\n\n    protected Object evaluateScript(ScriptingEngines scriptingEngines, ScriptEngineRequest request) {\n        return scriptingEngines.evaluate(request).getResult();\n    }\n\n    protected void validateParameters() {\n        if (script == null) {\n            throw new FlowableIllegalStateException(\"The field 'script' should be set on \" + getClass().getSimpleName());\n        }\n\n        if (language == null) {\n            throw new FlowableIllegalStateException(\"The field 'language' should be set on \" + getClass().getSimpleName());\n        }\n    }\n\n    protected abstract ScriptingEngines getScriptingEngines();\n\n    public void setScript(String script) {\n        this.script = script;\n    }\n\n    /**\n     * Sets the script as Expression for backwards compatibility.\n     * Requires to for 'field' injection of scripts.\n     * Expression is not evaluated\n     */\n    public void setScript(Expression script) {\n        this.script = script.getExpressionText();\n    }\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/scripting/AbstractScriptEvaluator.java#L85-L121","documentation":"validateParameters() found the 'language' field null on a script evaluator, meaning no script language was configured, so no ScriptEngine can be resolved. The concrete class name is included in the message.","triggerScenarios":"Instantiating an AbstractScriptEvaluator subclass without calling setLanguage(...) and then invoking createScriptRequest()/evaluate; differs from error 1797 in that the language Expression itself is null rather than evaluating to null.","commonSituations":"Custom listener/delegate missing the language property in Spring config; BPMN script task without language attribute; older BPMN files migrated to a Flowable version requiring explicit language.","solutions":["Call setLanguage(\"groovy\" / \"javascript\" / ...) on the evaluator before use","Set the language attribute on the script task/listener in BPMN XML","Inject the language property in the bean/deployment configuration"],"exampleFix":"// before\nGroovyScriptEvaluator eval = new GroovyScriptEvaluator();\neval.setScript(\"return 1;\");\n// after\nGroovyScriptEvaluator eval = new GroovyScriptEvaluator();\neval.setScript(\"return 1;\");\neval.setLanguage(\"groovy\");","handlingStrategy":"validation","validationCode":"if (evaluator.getLanguage() == null) {\n    throw new IllegalStateException(\"language property not injected on \" + evaluator.getClass().getSimpleName());\n}","typeGuard":null,"tryCatchPattern":"try {\n    return evaluator.createScriptRequest(variableContainer).build();\n} catch (FlowableIllegalStateException e) {\n    if (e.getMessage().contains(\"field 'language'\")) {\n        throw new IllegalStateException(\"Configure the language property on \" + e.getMessage(), e);\n    }\n    throw e;\n}","preventionTips":["Call setLanguage(...) at construction/bean init time","Validate evaluator configuration at deployment/startup","Ensure BPMN script tasks always carry a language attribute"],"tags":["scripting","listener","missing-property"],"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"}