Not able to get process configuration source using plain java API on RTC 6!
Hello ,
I am trying to get the process configuration source xml using java api through the code below:
IProcessClientService processClient = (IProcessClientService) teamRepository.getClientLibrary(IProcessClientService.class);
URI uri = URI.create(projectArea.replaceAll(" ", "%20"));
try {
processArea = (IProcessArea) processClient.findProcessArea(uri, null, null);
}
catch (TeamRepositoryException e)
{
e.printStackTrace();
}
IProcessItemService processItemService = (IProcessItemService) teamRepository.getClientLibrary(IProcessItemService.class);
IWorkingCopyManager workingCopyMgr = processItemService.getWorkingCopyManager(); IProjectAreaWorkingCopy projectAreaCopy = (IProjectAreaWorkingCopy) workingCopyMgr.createPrivateWorkingCopy(processArea);
IDocument doc = projectAreaCopy.getProcessSpecification();
String docXml = doc.get();
I don't see any error or any exceptions anywhere and the user used to log in has access to process specification which i confirmed through the eclipse client.
The same code works with client 5 libraries for RTC 6.0.4 server but not with client 6 libraries.
Am i missing something or is there something more to be done server side to make it compatible with version 6 libraries? I am quite new to extending RTC so please forgive me if there are any mistakes.
|
Accepted answer
Thanks Ralph.
Just to update if anyone else comes around a similar issue, after debugging a little and reading around i found the issue to be similar to this defect: Defect 421308
Ralph Schoon selected this answer as the correct answer
|
One other answer
Ralph Schoon (63.4k●3●36●46)
| answered Aug 09 '18, 8:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I have this snippet lying around. Don't ask me about details.
// get it IProjectArea project = (IProjectArea) (repo .itemManager().fetchCompleteItem(iparenthandle, IItemManager.DEFAULT, sPm)); System.out.println("have parent project name = " + project.getName()); // get the process data @SuppressWarnings("unchecked") Map<string, object=""> pd = ip.getProcessData(); //// here is the xml extract // get the process config content object IContent processSource = (IContent) pd.get(keyname); if (processSource != null) { System.out.println("have xml source"); saveXMLSource(ip, processSource, icm, sPm); } Comments
Prathamesh Dharangutte
commented Aug 10 '18, 1:57 a.m.
Thank you for your reply.
After trying, i get exception at:
icm.retrieveContent(processSource, os, null);
I get exception as below:
com.ibm.team.repository.common.TeamRepositoryException: The following header was missing from the server response: Content-Length.
As I said "Don't ask me about details.". I am pretty sure the code has worked. You could also search the SDK for how the code is used in the RTC client. I am not going to remote debug this.
|
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.
Comments
UPDATE: