// if the process instance has no active nodes left, consider it ended
if (activeFlowNodeInstances.size() == 0) {
// embedded end events call their embedding sub processes to move on in the process
if (this.parentSubProcessNode != null) {
this.sendMessageToNodeActor(new TriggerMessage(processInstanceId, null), this.parentSubProcessNode);
LOG.debug(String.format("Sub-Process instance with instance id '%s' ended sucessfully", processInstanceId));
// top level end events will work with the whole process instance to either save or delete it
} else {
LOG.debug(String.format("Process instance with instance id '%s' ended sucessfully", processInstanceId));
}