{"record":{"id":"a83cd0d947c285f5","repo":"flowable/flowable-engine","slug":"process-instance-processinstanceid-is-suspended-a83cd0","errorCode":null,"errorMessage":"process instance <processInstanceId> is suspended, cannot set name","messagePattern":"process instance <processInstanceId> is suspended, cannot set name","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetProcessInstanceNameCmd.java","lineNumber":57,"sourceCode":"        if (processInstanceId == null) {\n            throw new ActivitiIllegalArgumentException(\"processInstanceId is null\");\n        }\n\n        ExecutionEntity execution = commandContext\n                .getExecutionEntityManager()\n                .findExecutionById(processInstanceId);\n\n        if (execution == null) {\n            throw new ActivitiObjectNotFoundException(\"process instance \" + processInstanceId + \" doesn't exist\", ProcessInstance.class);\n        }\n\n        if (!execution.isProcessInstanceType()) {\n            throw new ActivitiObjectNotFoundException(\"process instance \" + processInstanceId +\n                    \" doesn't exist, the given ID references an execution, though\", ProcessInstance.class);\n        }\n\n        if (execution.isSuspended()) {\n            throw new ActivitiException(\"process instance \" + processInstanceId + \" is suspended, cannot set name\");\n        }\n\n        // Actually set the name\n        execution.setName(name);\n\n        // Record the change in history\n        commandContext.getHistoryManager().recordProcessInstanceNameChange(processInstanceId, name);\n\n        return null;\n    }\n\n}\n","sourceCodeStart":39,"sourceCodeEnd":70,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SetProcessInstanceNameCmd.java#L39-L70","documentation":"SetProcessInstanceNameCmd throws ActivitiException when the target process instance is suspended. The engine blocks name changes on suspended instances because a suspended instance must not receive mutations until resumed. The command aborts before setting the name or recording history.","triggerScenarios":"Calling RuntimeService.setProcessInstanceName(processInstanceId, name) on an instance paused via runtimeService.suspendProcessInstanceById(...) or suspended through its process definition.","commonSituations":"Admin renaming an instance on maintenance hold; bulk suspension by definition applied before the rename; race between a suspension sweep and a rename job.","solutions":["Resume the instance with runtimeService.activateProcessInstanceById(processInstanceId), set the name, then re-suspend if needed.","Check suspension state beforehand via ProcessInstanceQuery.suspended() and skip or queue the rename.","Avoid suspending instances that pending administration operations still need to modify."],"exampleFix":"// before\nruntimeService.setProcessInstanceName(processInstanceId, \"monthly-run\");\n// after\nruntimeService.activateProcessInstanceById(processInstanceId);\nruntimeService.setProcessInstanceName(processInstanceId, \"monthly-run\");","handlingStrategy":"validation","validationCode":"boolean suspended = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).suspended().count() > 0;\nif (suspended) runtimeService.activateProcessInstanceById(processInstanceId);","typeGuard":null,"tryCatchPattern":"try {\n    runtimeService.setProcessInstanceName(processInstanceId, name);\n} catch (ActivitiException e) {\n    logger.warn(\"Instance {} suspended; rename skipped\", processInstanceId, e);\n}","preventionTips":["Check suspension state before any mutation of an instance.","Coordinate suspend/activate windows with background admin jobs.","Re-suspend after the rename if the hold must persist."],"tags":["process-instance","suspended-state","workflow"],"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"}