/** * Adds a category defining the process * * @param category * the category name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addCategory(final String category) { Misc.checkArgsNotNull(category); if ("".equals(category.trim())) { problems.add(new Problem("Category name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; process.addCategory(category); } else { problems.add(new Problem("Unable to add category " + category + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }
/** * Adds a category defining the process * * @param category * the category name * @return the ProcessBuilder in order to add BPM elements */ public ProcessBuilder addCategory(final String category) { Misc.checkArgsNotNull(category); if ("".equals(category.trim())) { problems.add(new Problem("Category name is an empty string.", Problem.SEVERITY_ERROR)); } final Object obj = peek(ProcessDefinitionImpl.class); if (isProcess(obj)) { final ProcessDefinitionImpl process = (ProcessDefinitionImpl) obj; process.addCategory(category); } else { problems.add(new Problem("Unable to add category " + category + " on an object of type: " + getClass(obj), Problem.SEVERITY_ERROR)); } return this; }