{"record":{"id":"9e61228a1af4ddda","repo":"flowable/flowable-engine","slug":"cannot-execution-operation-because-execution","errorCode":null,"errorMessage":"Cannot execution operation because execution '\" + executionId + \"' is suspended","messagePattern":"Cannot execution operation because execution '\" \\+ executionId \\+ \"' is suspended","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/NeedsActiveExecutionCmd.java","lineNumber":53,"sourceCode":"        this.executionId = executionId;\n    }\n\n    @Override\n    public T execute(CommandContext commandContext) {\n        if (executionId == null) {\n            throw new ActivitiIllegalArgumentException(\"executionId is null\");\n        }\n\n        ExecutionEntity execution = commandContext\n                .getExecutionEntityManager()\n                .findExecutionById(executionId);\n\n        if (execution == null) {\n            throw new ActivitiObjectNotFoundException(\"execution \" + executionId + \" doesn't exist\", Execution.class);\n        }\n\n        if (execution.isSuspended()) {\n            throw new ActivitiException(getSuspendedExceptionMessage());\n        }\n\n        return execute(commandContext, execution);\n    }\n\n    /**\n     * Subclasses should implement this method. The provided {@link ExecutionEntity} is guaranteed to be active (ie. not suspended).\n     */\n    protected abstract T execute(CommandContext commandContext, ExecutionEntity execution);\n\n    /**\n     * Subclasses can override this to provide a more detailed exception message that will be thrown when the execution is suspended.\n     */\n    protected String getSuspendedExceptionMessage() {\n        return \"Cannot execution operation because execution '\" + executionId + \"' is suspended\";\n    }\n\n}","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/NeedsActiveExecutionCmd.java#L35-L71","documentation":"Thrown when the execution identified by executionId exists but is in suspended state. NeedsActiveExecutionCmd.execute() explicitly blocks operations on suspended executions with an ActivitiException whose message comes from getSuspendedExceptionMessage(). The execution must be activated before the operation can proceed.","triggerScenarios":"Any command extending NeedsActiveExecutionCmd (signal, trigger, setting variables on the execution, etc.) executed while the execution's process instance or definition was suspended via runtimeService.suspendProcessInstanceById / suspendProcessDefinitionById.","commonSituations":"Administrator suspended a process definition for a release/migration and ongoing instances got suspended; a timer or message arrives for a suspended instance; test environments left suspended from previous runs.","solutions":["Resume the instance/execution first: runtimeService.activateProcessInstanceById(processInstanceId) (or activateProcessDefinitionById for definition-level suspension).","Check suspension state before the call: runtimeService.createProcessInstanceQuery().processInstanceId(pid).singleResult().isSuspended().","If the suspension was intentional, queue or defer the operation (e.g. delay the signal/job) until the instance is reactivated.","Review job/async executor settings so suspended instances' jobs are not retried into user-visible errors."],"exampleFix":"// before\nruntimeService.signal(executionId);\n\n// after\nExecution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();\nProcessInstance pi = runtimeService.createProcessInstanceQuery()\n    .processInstanceId(execution.getProcessInstanceId()).singleResult();\nif (pi.isSuspended()) {\n    runtimeService.activateProcessInstanceById(pi.getId());\n}\nruntimeService.signal(executionId);","handlingStrategy":"validation","validationCode":"ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(pid).singleResult();\nif (pi != null && pi.isSuspended()) runtimeService.activateProcessInstanceById(pid);","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.signal(executionId);\n} catch (ActivitiException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"is suspended\")) {\n        runtimeService.activateProcessInstanceById(processInstanceId);\n    }\n}","preventionTips":["Track suspension state in your application when admins suspend instances","Check isSuspended() before task/execution operations","Expose suspension state in UIs to disable actions"],"tags":["activiti","flowable","suspended-execution","state"],"backgroundTag":"invalid-state-transition","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"}