}
}
public void deleteHistoricProcessInstanceById(String historicProcessInstanceId) {
if (isHistoryEnabled()) {
CommandContext commandContext = Context.getCommandContext();
commandContext
.getHistoricDetailManager()
.deleteHistoricDetailsByProcessInstanceId(historicProcessInstanceId);
commandContext
.getHistoricVariableInstanceManager()
.deleteHistoricVariableInstanceByProcessInstanceId(historicProcessInstanceId);
commandContext
.getHistoricActivityInstanceManager()
.deleteHistoricActivityInstancesByProcessInstanceId(historicProcessInstanceId);
commandContext
.getHistoricTaskInstanceManager()
.deleteHistoricTaskInstancesByProcessInstanceId(historicProcessInstanceId);
commandContext
.getOperationLogManager()
.deleteOperationLogEntriesByProcessInstanceId(historicProcessInstanceId);
commandContext
.getHistoricIncidentManager()
.deleteHistoricIncidentsByProcessInstanceId(historicProcessInstanceId);
commandContext.getDbEntityManager().delete(HistoricProcessInstanceEntity.class, "deleteHistoricProcessInstance", historicProcessInstanceId);
}
}