flowable/flowable-engine · error · FlowableObjectNotFoundException
No historic case instance to be reactivated found with id:
Error message
No historic case instance to be reactivated found with id:
What it means
After validating the id, ReactivateHistoricCaseInstanceCmd queries the historic case instance store. If no historic case instance matches the given id it throws FlowableObjectNotFoundException 'No historic case instance to be reactivated found with id: <id>' with HistoricCaseInstance.class, meaning there is no completed case instance history record under that id to reactivate.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/ReactivateHistoricCaseInstanceCmd.java:71
public ReactivateHistoricCaseInstanceCmd(CaseReactivationBuilderImpl reactivationBuilder) {
this.reactivationBuilder = reactivationBuilder;
}
@Override
public CaseInstance execute(CommandContext commandContext) {
if (reactivationBuilder.getCaseInstanceId() == null) {
throw new FlowableIllegalArgumentException("No historic case instance id provided");
}
// Check if the historic case instance is found and if it is no longer running
CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);
HistoricCaseInstance instance = cmmnEngineConfiguration.getHistoricCaseInstanceEntityManager().createHistoricCaseInstanceQuery()
.caseInstanceId(reactivationBuilder.getCaseInstanceId())
.singleResult();
if (instance == null) {
throw new FlowableObjectNotFoundException("No historic case instance to be reactivated found with id: " + reactivationBuilder.getCaseInstanceId(), HistoricCaseInstance.class);
}
if (instance.getEndTime() == null) {
throw new FlowableIllegalStateException("Case instance is still running, cannot reactivate historic case instance: " + reactivationBuilder.getCaseInstanceId());
}
// move the case instance back to the runtime (this also checks, if the reactivation listener is even existent)
CaseInstanceEntity caseInstanceEntity = cmmnEngineConfiguration.getCaseInstanceHelper()
.copyHistoricCaseInstanceToRuntime(instance);
// reset the state to be active again and also set the last reactivation time as well as the current user triggering it
caseInstanceEntity.setState(CaseInstanceState.ACTIVE);
caseInstanceEntity.setLastReactivationTime(cmmnEngineConfiguration.getClock().getCurrentTime());
caseInstanceEntity.setLastReactivationUserId(Authentication.getAuthenticatedUserId());
// set case variables, if the builder contains any
if (reactivationBuilder.hasVariables()) {
caseInstanceEntity.setVariables(reactivationBuilder.getVariables());
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Confirm the historic record exists: cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceId(id).singleResult() != null and finished == true
- If the case is still running, don't reactivate — operate on the runtime instance instead
- Enable/raise the CMMN history level (e.g. audit) so finished cases are persisted, and check history cleanup settings
- Catch FlowableObjectNotFoundException to handle missing historic instances gracefully
Example fix
// before
cmmnRuntimeService.createCaseInstanceReactivationBuilder().caseInstanceId(runningCaseId)... // not in history
// after
HistoricCaseInstance h = cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceId(id).finished().singleResult();
if (h != null) { cmmnRuntimeService.createCaseInstanceReactivationBuilder().caseInstanceId(h.getId())... } Defensive patterns
Strategy: validation
Validate before calling
HistoricCaseInstance h = cmmnHistoryService.createHistoricCaseInstanceQuery().caseInstanceId(id).finished().singleResult();
if (h == null) throw new IllegalArgumentException("No finished historic case instance with id " + id); Try / catch
try { reactivationBuilder.caseInstanceId(id).reactivate(); } catch (FlowableObjectNotFoundException e) { log.warn("Historic case instance {} not found", id); } Prevention
- Only reactivate ids confirmed via HistoricCaseInstanceQuery with finished() filter
- Keep history level at audit or higher so completed cases are persisted
- Account for history cleanup jobs when reactivating old instances
When it happens
Trigger: Calling reactivate() with an id of a still-running (non-historic) case instance, a never-existing id, or an id from a system where CMMN history was purged or never recorded (history level too low).
Common situations: Id of a running case instance passed instead of the historic one; history cleanup job deleted the record; history level configured below audit so no historic instance was persisted; ids from another environment/database.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- No External Worker job found for id: ${externalJobId}
- historic case instanceIds are null
- historic case instanceIds are empty
- Could not find task entity for id
- No historic task exists with the given id:
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/14b70b68f8c16a24.
Report an issue: GitHub.