docs: public void initHistoryLevel() {
      if (historyLevel != null) {
        setHistory(historyLevel.getName());
      }
  
      if (historyLevels == null) {
        historyLevels = new ArrayList<HistoryLevel>();
        historyLevels.add(HistoryLevel.HISTORY_LEVEL_NONE);
        historyLevels.add(HistoryLevel.HISTORY_LEVEL_ACTIVITY);
        historyLevels.add(HistoryLevel.HISTORY_LEVEL_AUDIT);
        historyLevels.add(HistoryLevel.HISTORY_LEVEL_FULL);
      }
  
      if (customHistoryLevels != null) {
        historyLevels.addAll(customHistoryLevels);
      }
  
      if (HISTORY_VARIABLE.equalsIgnoreCase(history)) {
        historyLevel = HistoryLevel.HISTORY_LEVEL_ACTIVITY;
        LOG.usingDeprecatedHistoryLevelVariable();
      } else {
        for (HistoryLevel historyLevel : historyLevels) {
          if (historyLevel.getName().equalsIgnoreCase(history)) {
            this.historyLevel = historyLevel;
          }
        }
      }
  
      // do allow null for history level in case of "auto"
      if (historyLevel == null && !ProcessEngineConfiguration.HISTORY_AUTO.equalsIgnoreCase(history)) {
        throw new ProcessEngineException("invalid history level: " + history);
      }
    }