code: @Override
    public void recordHistoricDetailVariableCreate(VariableInstanceEntity variable, ExecutionEntity sourceActivityExecution, boolean useActivityId) {
      if (isHistoryLevelAtLeast(HistoryLevel.FULL)) {
  
        HistoricDetailVariableInstanceUpdateEntity historicVariableUpdate = getHistoricDetailEntityManager().copyAndInsertHistoricDetailVariableInstanceUpdateEntity(variable);
  
        if (useActivityId && sourceActivityExecution != null) {
          HistoricActivityInstanceEntity historicActivityInstance = findActivityInstance(sourceActivityExecution, false, false);
          if (historicActivityInstance != null) {
            historicVariableUpdate.setActivityInstanceId(historicActivityInstance.getId());
          }
        }
      }
    }
docs: /*
  (non-Javadoc)
  
  @see org.activiti.engine.impl.history.HistoryManagerInterface# recordHistoricDetailVariableCreate (org.activiti.engine.impl.persistence.entity.VariableInstanceEntity,
  org.activiti.engine.impl.persistence.entity.ExecutionEntity, boolean)