{"record":{"id":"85f794998a7c5ec3","repo":"flowable/flowable-engine","slug":"no-execution-could-be-found-for-id-executionid","errorCode":null,"errorMessage":"No execution could be found for id {executionId}","messagePattern":"No execution could be found for id (.+?)","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/impl/process/DefaultProcessInstanceService.java","lineNumber":125,"sourceCode":"        return processInstance.getId();\n    }\n    \n\n    @Override\n    public void triggerCaseTask(String executionId, Map<String, Object> variables) {\n        processEngineConfiguration.getCommandExecutor().execute(new TriggerCaseTaskCmd(executionId, variables));\n    }\n\n    @Override\n    public void handleCaseTaskError(String executionId, BusinessError error) {\n        processEngineConfiguration.getCommandExecutor().execute(new HandleCaseTaskErrorCmd(executionId, error));\n    }\n    \n    @Override\n    public List<IOParameter> getOutputParametersOfCaseTask(String executionId) {\n        ExecutionEntity execution = (ExecutionEntity) processEngineConfiguration.getExecutionEntityManager().findById(executionId);\n        if (execution == null) {\n            throw new FlowableException(\"No execution could be found for id \" + executionId);\n        }\n        \n        FlowElement flowElement = execution.getCurrentFlowElement();\n        if (!(flowElement instanceof CaseServiceTask caseServiceTask)) {\n            // The execution already processed this stage, there is no need to copy parameters anymore.\n            // One possible reason for this is that the case task was terminated by a boundary event.\n            return Collections.emptyList();\n        }\n        \n        List<IOParameter> cmmnParameters = new ArrayList<>();\n\n        List<org.flowable.bpmn.model.IOParameter> parameters = caseServiceTask.getOutParameters();\n        for (org.flowable.bpmn.model.IOParameter ioParameter : parameters) {\n            IOParameter parameter = new IOParameter();\n            parameter.setSource(ioParameter.getSource());\n            parameter.setSourceExpression(ioParameter.getSourceExpression());\n            parameter.setSourceType(ioParameter.getSourceType());\n            parameter.setTarget(ioParameter.getTarget());","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine-configurator/src/main/java/org/flowable/cmmn/engine/configurator/impl/process/DefaultProcessInstanceService.java#L107-L143","documentation":"Thrown by DefaultProcessInstanceService.getOutputParametersOfCaseTask when the BPMN execution id used to look up the calling case task does not exist. The engine needs the execution to read the CaseServiceTask flow element and copy output parameters back into the case; without the execution it cannot proceed.","triggerScenarios":"The case task completion callback queries ExecutionEntityManager.findById(executionId) and gets null — the execution id passed in is stale, wrong, or the process instance was deleted before case-task completion was processed.","commonSituations":"Calling deleteProcessInstance on a process that contains an active case task, then the case finishes the task; corrupted/mismatched ids when moving data between databases; custom code invoking getOutputParametersOfCaseTask with a fabricated id.","solutions":["Verify the executionId is the live id of the execution currently sitting on the case task (ExecutionQuery) before resolving output parameters","Avoid deleting the process instance while its case task completion callback is still pending","Catch FlowableException and skip output-parameter copying when the execution is gone (the surrounding code already skips when the flow element is no longer a CaseServiceTask)","Restore consistency between CMMN and BPMN runtime tables if ids drifted (re-run repair/consistency checks)"],"exampleFix":"// before\nList<IOParameter> params = processInstanceService.getOutputParametersOfCaseTask(executionId);\n\n// after\nExecution exec = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nList<IOParameter> params = exec != null\n    ? processInstanceService.getOutputParametersOfCaseTask(executionId)\n    : Collections.emptyList();","handlingStrategy":"validation","validationCode":"Execution exec = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nif (exec == null) { /* skip output-parameter copy */ }","typeGuard":null,"tryCatchPattern":"try {\n    params = processInstanceService.getOutputParametersOfCaseTask(executionId);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"No execution could be found\")) {\n        params = Collections.emptyList();\n    } else { throw e; }\n}","preventionTips":["Never delete a process instance whose case task callback is still pending","Always resolve executions via ExecutionQuery before using raw ids","Keep CMMN and BPMN runtime tables in the same database/transaction scope"],"tags":["cmmn","bpmn","execution","lookup"],"backgroundTag":"entity-not-found","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"}