How to add Literals to existing enumeration programmatically
Is there any way in RTC to add the literals to the existing enumerations programmatically using RTC JAVA API's.?
For Eaxmple: Suppose we have enumeration called Operating System but we need to add the literal values(like WindowsXP , Linux etc.) for this enumeration programmatically using RTC JAVA API's.
Please let me if anyone has any idea.
6 answers
Hi
Is there any way in RTC to add the literals to the existing enumerations programmatically using RTC JAVA API's.?
For Eaxmple: Suppose we have enumeration called Operating System but we need to add the literal values(like WindowsXP , Linux etc.) for this enumeration programmatically using RTC JAVA API's.
Please let me if anyone has any idea.
You either make a new attribute of type enumeration with the values you want or write a piece of code to edit the xml you can get through the eclipse client
IClientProcess clientProcess1 = service.getClientProcess(
processAreaNew, null);
IProcessConfigurationData processConfigurationData = clientProcess1.getProjectConfigurationData("com.ibm.team.workitem.configuration.enumerations", monitor);
System.out.println("Process configuration data:\n"+processConfigurationData.getElements());
IProcessConfigurationElement[] processConfigArray = processConfigurationData.getElements();
System.out.println("processConfigArray : "+processConfigArray.length);
for(int i=0 ; i<processConfigArray.length; i++){
IProcessConfigurationElement a = processConfigArray[i];
System.out.println("Enumeration Element : "+a.getName());
a.getChildren();
System.out.println("a.getChildren():"+a.getChildren());
System.out.println("a.getChildren().length:"+a.getChildren().length);
IProcessConfigurationElement[] childs = a.getChildren();
for (int j=0 ; j<a.getChildren().length; j++){
IProcessConfigurationElement literal = childs[j];
System.out.println("Literal Element : "+literal.getName());
System.out.println("abc:"+literal.toString());
literal.getAttribute("name").toString();
literal.getAttribute("id").toString();
}
so, you will have to read the source for the product UI and discover how they did it, and knowing there is no api, your code will be exposed to undocumented changes in the implementation.. so net, after you learn it, you shouldn't skip around the safety net and write direct code..
ps.. I have had to do this myself.. I submitted Enhancements to Jazz to enable my code to be using supported methods in the future..
1 was accepted(shipped in 3.0.1), 1 was rejected, 1 was being worked on already (maybe to ship in 3.5)
Sam
Is it possible to create the enumeration and configure the dependency and value-set provider programatically? (or) Is it only possible by editing process template?
My requirement is to automatically populate stream-list from the repo for a chosen project-area - so this has to be dynamic.
Please advise.
Thanks.
Hi All,
Is it programmatically possible to get the operation id from the process configuration source?
I need to get acess to the id of the operation behavior.
The id which I am trying to access from the process configuration source is
<behavior>
<role id="default">
<operation id="com.ibm.team.workitem.operation.workItemSave">
<preconditions>
I need to get access to the operation id of the behavior "com.ibm.team.workitem.operation.workItemSave". Can you please help me with the interface and the method. Thanks
Hi All,
Is it programmatically possible to get the operation id from the process configuration source?
I need to get acess to the id of the operation behavior.
The id which I am trying to access from the process configuration source is
<behavior>
<role id="default">
<operation id="com.ibm.team.workitem.operation.workItemSave">
<preconditions>
I need to get access to the operation id of the behavior "com.ibm.team.workitem.operation.workItemSave". Can you please help me with the interface and the method. Thanks