JAVA API Client : Null output when using findProcessArea(uri,nulll,null)
Accepted answer
One other answer
Comments
Hello Ralph Schoon,
Thanks for reply
I have used the example code available in RSjazz.
I have created the project Ares (Process Area) I have checked for all project area available.(Also with the alais name)
Here is the code :
ITeamRepository teamRepository= TeamPlatform.getTeamRepositoryService().getTeamRepository(repositoryURI);
teamRepository.registerLoginHandler(new LoginHandler(userId, password));
teamRepository.login(null);
IProcessClientService processClient= (IProcessClientService) teamRepository.getClientLibrary(IProcessClientService.class);
IAuditableClient auditableClient= (IAuditableClient) teamRepository.getClientLibrary(IAuditableClient.class);
IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);
System.out.println(processClient);
URI uri= URI.create(projectAreaName.replaceAll(" ", "%20"));
System.out.println(projectAreaName);
System.out.println(uri);
IProjectArea projectArea= (IProjectArea) processClient.findProcessArea(uri, null, null);
System.out.println(projectArea);
if (projectArea == null) {
System.out.println("Project area not found.");
return false;
}
This is all not useful information, because what really would matter is the String that is passed to create the URI and the URI as string to check if there might be any funny pre or postfix values.
A valid program is not able to work if the input is invalid. I know, my code above works, because I have used it like 30 times already and it works for me. So the only possible data producing issues is the input.
And i believe you created the project areas and the like, but I also believe that you pass the wrong information to the code above, which results in a not found, because what you search for is not there and what is there you don't search for.
Hello Ralph Schoon,
I apologise , I Actually know that code is good as I have tried lot of the code in your blog and its really good and makes us to learn lot and interesting .But this input I am really trying but do not know what is the wrong I am doing ...
Thanks again .. I will try it ..
Yes, the project areas are managed by the application and not JTS.
Trouble is you don't notice, because the JTS shares some common API with apps like CCM and you can actually log in.
Don't worry, stuff like that happened to probably all of us. Your learning here should be to provide the information for debugging next time. You can obfuscate it a bit, if needed.