{"record":{"id":"77e916d265a26d7b","repo":"flowable/flowable-engine","slug":"could-not-execute-script-task-instance-no-scripti","errorCode":null,"errorMessage":"Could not execute script task instance: no scripting engines found. For ${planItemInstanceEntity}","messagePattern":"Could not execute script task instance: no scripting engines found\\. For (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/ScriptTaskActivityBehavior.java","lineNumber":49,"sourceCode":"import org.flowable.common.engine.impl.variable.MapDelegateVariableContainer;\n\n/**\n * Implementation of ScriptActivity CMMN 2.0 PlanItem.\n */\npublic class ScriptTaskActivityBehavior extends TaskActivityBehavior {\n\n    protected ScriptServiceTask scriptTask;\n\n    public ScriptTaskActivityBehavior(ScriptServiceTask scriptTask) {\n        super(scriptTask.isBlocking(), scriptTask.getBlockingExpression());\n        this.scriptTask = scriptTask;\n    }\n\n    @Override\n    public void execute(CommandContext commandContext, PlanItemInstanceEntity planItemInstanceEntity) {\n        ScriptingEngines scriptingEngines = CommandContextUtil.getCmmnEngineConfiguration().getScriptingEngines();\n        if (scriptingEngines == null) {\n            throw new FlowableException(\"Could not execute script task instance: no scripting engines found. For \" + planItemInstanceEntity);\n        }\n        String scriptFormat = scriptTask.getScriptFormat() != null ? scriptTask.getScriptFormat() : ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE;\n        \n        try {\n            ScriptEngineRequest.Builder request = ScriptEngineRequest.builder()\n                    .language(scriptFormat)\n                    .script(scriptTask.getScript())\n                    .scopeContainer(planItemInstanceEntity)\n                    .traceEnhancer(trace -> trace.addTraceTag(\"type\", \"scriptTask\"));\n            if (scriptTask.isAutoStoreVariables()) {\n                request.storeScriptVariables();\n            }\n\n            List<IOParameter> inParameters = scriptTask.getInParameters();\n            if (inParameters != null && !inParameters.isEmpty()) {\n                MapDelegateVariableContainer inputVariableContainer = new MapDelegateVariableContainer();\n                IOParameterUtil.processInParameters(inParameters, planItemInstanceEntity, inputVariableContainer,\n                        CommandContextUtil.getExpressionManager(commandContext));","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/ScriptTaskActivityBehavior.java#L31-L67","documentation":"A CMMN script task needs a JSR-223 ScriptingEngines component in the engine configuration to evaluate its script. When getScriptingEngines() returns null — no script engine support was configured — execute() throws a FlowableException and the plan item fails.","triggerScenarios":"execute() for a script task plan item runs while CmmnEngineConfiguration.getScriptingEngines() is null, i.e. the scripting module was never installed.","commonSituations":"Using flowable-cmmn-engine without the scripting dependency/segment (scriptingEngines not configured); GraalVM/native-image builds where javax.script engines are missing; spring-boot app excluding the script engine auto-configuration; running with a minimal engine config for tests.","solutions":["Add the scripting support: include the flowable-engine scripting segment/dependency (groovy-jsr223 or juel) so ScriptingEngines is registered in the configuration","Ensure a JSR-223 provider for the script language is on the classpath (e.g. org.codehaus.groovy:groovy for Groovy)","If scripts are not needed, refactor the case model to replace script tasks with service tasks or expressions","In Spring Boot, verify no exclusion of Flowable scripting auto-configuration and that javax.script.ScriptManagerFactory is available at runtime"],"exampleFix":"// before (pom.xml)\n<dependency>org.flowable:flowable-cmmn-engine</dependency> <!-- no scripting -->\n// after\n<dependency>org.flowable:flowable-cmmn-engine</dependency>\n<dependency>org.flowable:flowable-script-task</dependency> <!-- registers ScriptingEngines -->\n<dependency>org.codehaus.groovy:groovy</dependency> <!-- JSR-223 provider -->","handlingStrategy":"validation","validationCode":"ScriptEngineManager mgr = new ScriptEngineManager();\nif (mgr.getEngineByName(\"groovy\") == null) {\n    throw new IllegalStateException(\"No JSR-223 engine for script tasks\");\n}\n// plus: assert cmmnEngineConfiguration.getScriptingEngines() != null","typeGuard":null,"tryCatchPattern":"try {\n    cmmnRuntimeService.triggerPlanItemInstance(planItemId);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"no scripting engines found\")) {\n        // engine misconfiguration: add scripting module/dependency\n    }\n}","preventionTips":["Include the scripting segment/dependency whenever models contain script tasks","Ship a JSR-223 provider (Groovy etc.) on the runtime classpath","Prefer service tasks/expressions when scripting is not needed","Test script task execution in CI with the same classpath as production"],"tags":["cmmn","script-task","missing-dependency","jsr223"],"backgroundTag":"missing-dependency","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"}