private void save() throws Exception { for (Object object : table.getContainerDataSource().getItemIds()) { LightProcessDefinition lpd = (LightProcessDefinition) object; Set<String> cats = lpd.getCategoryNames(); cats.add(category.getName()); ProcessbaseApplication.getCurrent().getBpmModule().setProcessCategories(lpd.getUUID(), cats); } for (Object object : processesComboBox.getItemIds()) { LightProcessDefinition lpd = (LightProcessDefinition) object; Set<String> cats2 = lpd.getCategoryNames(); cats2.remove(category.getName()); ProcessbaseApplication.getCurrent().getBpmModule().setProcessCategories(lpd.getUUID(), cats2); } }
public void refreshTable() { try { table.removeAllItems(); Collection<LightProcessDefinition> processes = ProcessbaseApplication.getCurrent() .getBpmModule() .getLightProcessDefinitions(ProcessState.ENABLED); for (LightProcessDefinition pd : processes) { if (pd.getCategoryNames().contains(category.getName())) { addTableRow(pd); } else { Item woItem = processesComboBox.addItem(pd); String caption = pd.getLabel() != null ? pd.getLabel() : pd.getName(); processesComboBox.setItemCaption(pd, caption + " (version " + pd.getVersion() + ")"); } } table.setSortContainerPropertyId("name"); table.setSortAscending(true); table.sort(); } catch (Exception ex) { ex.printStackTrace(); showError(ex.getMessage()); } }
public CategoryWindow(Category category) { super(category.getName()); this.category = category; }