{"record":{"id":"68b9902a3006cad3","repo":"flowable/flowable-engine","slug":"error-evaluating-juel-script-script-for-ex","errorCode":null,"errorMessage":"Error evaluating juel script: \"${script}\" for ${execution}","messagePattern":"Error evaluating juel script: \"(.+?)\" for (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/ScriptTaskActivityBehavior.java","lineNumber":146,"sourceCode":"                .language(language).scopeContainer(execution);\n        builder = storeScriptVariables ? builder.storeScriptVariables() : builder;\n        FlowElement flowElement = execution.getCurrentFlowElement();\n        if (flowElement instanceof ScriptTask scriptTask) {\n            List<IOParameter> inParameters = scriptTask.getInParameters();\n            if (inParameters != null && !inParameters.isEmpty()) {\n                MapDelegateVariableContainer inputVariableContainer = new MapDelegateVariableContainer();\n                IOParameterUtil.processInParameters(inParameters, execution, inputVariableContainer, processEngineConfiguration.getExpressionManager());\n                builder.inputVariableContainer(inputVariableContainer);\n            } else if (scriptTask.isDoNotIncludeVariables()) {\n                builder.inputVariableContainer(VariableContainer.empty());\n            }\n        }\n        ScriptEngineRequest request = builder.build();\n        Object result = scriptingEngines.evaluate(request).getResult();\n\n        if (null != result) {\n            if (\"juel\".equalsIgnoreCase(language) && (result instanceof String) && script.equals(result.toString())) {\n                throw new FlowableException(\"Error evaluating juel script: \\\"\" + script + \"\\\" for \" + execution);\n            }\n        }\n\n        if (resultVariable != null) {\n            execution.setVariable(resultVariable, result);\n        }\n    }\n}\n","sourceCodeStart":128,"sourceCodeEnd":155,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/behavior/ScriptTaskActivityBehavior.java#L128-L155","documentation":"ScriptTaskActivityBehavior.executeScript throws this when a JUEL script appears not to have been evaluated: the script engine returned a String identical to the original script text, meaning the expression was echoed back unchanged instead of being resolved. Flowable treats that as a failed evaluation and stops the execution.","triggerScenarios":"A script task with language 'juel' whose script source is returned verbatim by scriptingEngines.evaluate — typically when the JUEL engine is not properly registered/selected, or the script contains no expression markers so it is treated as a literal.","commonSituations":"Misspelled script language (e.g. 'JUEL' handled by a fallback engine), a script with no ${...} expression, or a scripting engine configuration change after upgrading Flowable so the juel engine resolves to a passthrough implementation.","solutions":["Verify the script task's language attribute is exactly 'juel' and that the JUEL scripting engine is on the classpath","Wrap the script content in a proper JUEL expression (e.g. ${expr}) if you intended expression evaluation","Check ScriptingEngines configuration for a resolver that may have been removed/renamed after a Flowable version upgrade","Test the same expression with Flowable's expression manager outside the script task to confirm evaluation works"],"exampleFix":"// before\n<scriptTask scriptFormat=\"juel\"><script>user.name</script></scriptTask>\n// after\n<scriptTask scriptFormat=\"juel\"><script>${user.name}</script></scriptTask>","handlingStrategy":"try-catch","validationCode":"// Ensure the script contains an expression marker before executing\nif (language.equalsIgnoreCase(\"juel\") && !script.contains(\"${\")) {\n    throw new IllegalArgumentException(\"JUEL script must be an expression: \" + script);\n}","typeGuard":null,"tryCatchPattern":"try {\n    execution = taskExecutor.execute(activityId);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Error evaluating juel script\")) {\n        // fix script language/expression syntax\n    }\n}","preventionTips":["Always use scriptFormat=\"juel\" with ${...} wrapped expressions","Pin the Flowable scripting engine configuration in version upgrades","Unit-test script tasks with the same expression manager used at runtime"],"tags":["scripting","juel","expression","flowable"],"backgroundTag":"unsupported-operation","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"}