Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Retrieving Enumerations in RTC Jazz

The programmatic method to retrieve an enummeration is by using  :
IEnumeration enumeration= workItemCommon.resolveEnumeration(attribute, monitor);

However in our case no attributes are tagged to the enumeration we are trying to retrieve. So the above method cannot be used.

Is there an alternate way to accomplish this ? Please help

Thanks

1 vote



One answer

Permanent link
 There is a way that I've found however it's not particularly pretty, and essentially requires you to manually process the process configuration source. The below example iterates through all enumerations and prints out the id and name, and the id and name of all literals within the enumeration (see here for a slightly better formatted version):

ITeamRepository repository = ...
String projectUri = ...
IProcessItemService processItemService = 
	(IProcessItemService) repository.getClientLibrary(IProcessItemService.class);
IProjectArea projectArea = 
	(IProjectArea) processItemService.findProcessArea(URI.create(projectUri), null, null);
IClientProcess clientProcess = 
	processItemService.getClientProcess(projectArea, null);
IProcessConfigurationData enumerationConfigurationData = 
	clientProcess.getProjectConfigurationData("com.ibm.team.workitem.configuration.enumerations", null);
for(IProcessConfigurationElement enumerationElement : enumerationConfigurationData.getElements()) {
	System.out.println("Enumeration Id: " + enumerationElement.getAttribute("attributeTypeId"));
	System.out.println("Enumeration Name: " + enumerationElement.getName());
	for(IProcessConfigurationElement literalElement : enumerationElement.getChildren()) {
		System.out.println("\tId: " + literalElement.getAttribute("id") 
				+ " Name: " + literalElement.getAttribute("name"));
	}
}
	
	
	

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Sep 14 '12, 3:38 a.m.

Question was seen: 6,337 times

Last updated: Sep 14 '12, 9:18 a.m.

Confirmation Cancel Confirm