code: @Override
    public void recordSubProcessInstanceStart(ExecutionEntity parentExecution, ExecutionEntity subProcessInstance, FlowElement initialElement) {
      if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
  
        HistoricProcessInstanceEntity historicProcessInstance = getHistoricProcessInstanceEntityManager().create(subProcessInstance); 
  
        // Fix for ACT-1728: startActivityId not initialized with subprocess instance
        if (historicProcessInstance.getStartActivityId() == null) {
          historicProcessInstance.setStartActivityId(initialElement.getId());
        }
        getHistoricProcessInstanceEntityManager().insert(historicProcessInstance, false);
        
        // Fire event
        ActivitiEventDispatcher activitiEventDispatcher = getEventDispatcher();
        if (activitiEventDispatcher != null && activitiEventDispatcher.isEnabled()) {
          activitiEventDispatcher.dispatchEvent(
              ActivitiEventBuilder.createEntityEvent(ActivitiEventType.HISTORIC_PROCESS_INSTANCE_CREATED, historicProcessInstance));
        }
  
        HistoricActivityInstanceEntity activitiyInstance = findActivityInstance(parentExecution, false, true);
        if (activitiyInstance != null) {
          activitiyInstance.setCalledProcessInstanceId(subProcessInstance.getProcessInstanceId());
        }
  
      }
    }
docs: /*
  (non-Javadoc)
  
  @see org.activiti.engine.impl.history.HistoryManagerInterface# recordSubProcessInstanceStart (org.activiti.engine.impl.persistence.entity.ExecutionEntity,
  org.activiti.engine.impl.persistence.entity.ExecutionEntity)