code: @Override
    public void recordActivityStart(ExecutionEntity executionEntity) {
      if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
        if (executionEntity.getActivityId() != null && executionEntity.getCurrentFlowElement() != null) {
          
          HistoricActivityInstanceEntity historicActivityInstanceEntity = null;
          
          // Historic activity instance could have been created (but only in cache, never persisted)
          // for example when submitting form properties
          HistoricActivityInstanceEntity historicActivityInstanceEntityFromCache = 
              getHistoricActivityInstanceFromCache(executionEntity.getId(), executionEntity.getActivityId(), true);
          if (historicActivityInstanceEntityFromCache != null) {
            historicActivityInstanceEntity = historicActivityInstanceEntityFromCache;
          } else {
            historicActivityInstanceEntity = createHistoricActivityInstanceEntity(executionEntity);
          }
          
          // Fire event
          ActivitiEventDispatcher activitiEventDispatcher = getEventDispatcher();
          if (activitiEventDispatcher != null && activitiEventDispatcher.isEnabled()) {
            activitiEventDispatcher.dispatchEvent(
                ActivitiEventBuilder.createEntityEvent(ActivitiEventType.HISTORIC_ACTIVITY_INSTANCE_CREATED, historicActivityInstanceEntity));
          }
          
        }
      }
    }
docs: /*
  (non-Javadoc)
  
  @see org.activiti.engine.impl.history.HistoryManagerInterface#recordActivityStart (org.activiti.engine.impl.persistence.entity.ExecutionEntity)