Why is the activity instance not deleted in the history after cancelled the activity instance?

In my case I need to modify a process instance.
After I modifed the process instance by the java api of below the camunda did not delete the activity instance in history

private void undo(String processInstanceId, String activityIdOfForCancelAllInstance) {
runtimeService.createProcessInstanceModification(processInstanceId)
.startAfterActivity(“IntermediateThrowEvent_0cfmn6s”)
.cancelAllForActivity(activityIdOfForCancelAllInstance)
.execute();
}

So my question is how can I know a historicActivityInstance is or not be cancelled ?

Thanks you all.

Sorry guys, After I taked a look at HistoricActivityInstance api I finded the api. Here is the api.

HistoricActivityInstance# boolean isCanceled();

Api description:

/** Was this activity instance canceled */

Thank you all.