displayer.setDefaultSettings();
displayer.setTitle(kpi.getDescription(LocaleManager.currentLocale()));
displayer.setDataProvider(provider);
kpi.setDataDisplayer(displayer);
kpi.setCode(null);
kpi.save(); // The KPI's id and code are auto-generated here.
// Set a default description
Locale locale = LocaleManager.currentLocale();
ResourceBundle i18n = localeManager.getBundle("org.jboss.dashboard.ui.panel.kpi.messages", locale);
kpi.setDescription(i18n.getString("kpiDriver.newKpi"), locale);