Welcome to the Jazz Community Forum
How to pass URI parameter to IProcessServerService#findProcessArea method?

Hi,
Lets say I am having a Project area called "My Project Area". I want to get the IProjectArea for this and so I am trying to use IProcessServerService#findProcessArea method. I want to know How to convert my Project name as URI so that I can pass this as parameter.
Any example usage of converting String (Project Area name) to URI will be appreciated.
Thanks
Lets say I am having a Project area called "My Project Area". I want to get the IProjectArea for this and so I am trying to use IProcessServerService#findProcessArea method. I want to know How to convert my Project name as URI so that I can pass this as parameter.
Any example usage of converting String (Project Area name) to URI will be appreciated.
Thanks
Accepted answer

Here's how:
String projectAreaURI = java.net.URLEncoder.encode(projectAreaName, "UTF-8");
projectAreaURI = projectAreaURI.replace("+", "%20");
IProcessArea projectArea = processService.findProcessArea(new java.net.URI(projectAreaURI).toString(), null);
Hope that helps.
String projectAreaURI = java.net.URLEncoder.encode(projectAreaName, "UTF-8");
projectAreaURI = projectAreaURI.replace("+", "%20");
IProcessArea projectArea = processService.findProcessArea(new java.net.URI(projectAreaURI).toString(), null);
Hope that helps.
2 other answers

Looking at the code for IProcessServerService.findProcessArea() and at a few places where it is used, it looks like the URI parameter is just the name of the project area encoded as if it were part of a URL (such as changing spaces to "%20"). It is not a full URL, just a (properly encoded) project area name.
--
David Olsen, IBM Rational, Jazz Process Team