It's all about the answers!

Ask a question

APIs for Process information


Abhishek Minde (7121912) | asked May 26 '09, 5:42 p.m.
Hi,

What services (APIs) can give information about process?

Thank you.

Regards,
Abhishek

8 answers



permanent link
Ryan Manwiller (1.3k1) | answered May 27 '09, 2:05 p.m.
JAZZ DEVELOPER
You'll need to be more specific.

What product/version are you using?

Are you running in the eclipse client or server side?

permanent link
Marcelo Cataldo (6) | answered Jun 02 '09, 10:57 a.m.
Hello Ryan,
We are interested in accessing process related information from a plugin running on RTC 1.0. A pointer to the relevant information or unit tests that highlight api usage would be greatly appreciated
Marcelo

You'll need to be more specific.

What product/version are you using?

Are you running in the eclipse client or server side?

permanent link
Ryan Manwiller (1.3k1) | answered Jun 08 '09, 2:24 p.m.
JAZZ DEVELOPER
Here is some code that will enumerate all project areas and print their name
and process id. You could start with this and branch out by reading the
javadoc on these interfaces. You can get the source from the downloads page
on jazz.net. If you explain more what you are trying to do, I could give
better advice.


IProcessItemService client = (IProcessItemService)
repo.getClientLibrary(IProcessItemService.class);

List projectAreas =
client.findAllProjectAreas(IProcessClientService.ALL_PROPERTIES, null);

for (Object object : projectAreas) {
IProjectArea projectArea = (IProjectArea) object;
String processContentPath = projectArea.getProcessContentPath();
System.out.println("\n");
System.out.println("project: " + projectArea.getName());
System.out.println(processContentPath);
IProcessDefinition definition = (IProcessDefinition)
repo.itemManager().fetchCompleteItem(projectArea.getProcessDefinition(),
IItemManager.REFRESH, null);
System.out.println("process: " + definition.getProcessId());
}

permanent link
Abhishek Minde (7121912) | answered Jul 11 '09, 9:43 a.m.
Thanks Ryan. We tried it and it worked. It will be helpful if you can tell me how to fetch the team members roles. We were able to fetch the team members (contributors) from a team area. However, we are still trying to find the APIs that will give us list of roles that are defined in a process for which the user has logged in against.

Thanks again for you valuable advice.

Here is some code that will enumerate all project areas and print their name
and process id. You could start with this and branch out by reading the
javadoc on these interfaces. You can get the source from the downloads page
on jazz.net. If you explain more what you are trying to do, I could give
better advice.


IProcessItemService client = (IProcessItemService)
repo.getClientLibrary(IProcessItemService.class);

List projectAreas =
client.findAllProjectAreas(IProcessClientService.ALL_PROPERTIES, null);

for (Object object : projectAreas) {
IProjectArea projectArea = (IProjectArea) object;
String processContentPath = projectArea.getProcessContentPath();
System.out.println("\n");
System.out.println("project: " + projectArea.getName());
System.out.println(processContentPath);
IProcessDefinition definition = (IProcessDefinition)
repo.itemManager().fetchCompleteItem(projectArea.getProcessDefinition(),
IItemManager.REFRESH, null);
System.out.println("process: " + definition.getProcessId());
}

permanent link
Jared Burns (4.5k29) | answered Jul 14 '09, 8:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Sat, 11 Jul 2009 13:53:01 +0000, abhminde wrote:

Thanks Ryan. We tried it and it worked. It will be helpful if you can
tell me how to fetch the team members roles. We were able to fetch the
team members (contributors) from a team area. However, we are still
trying to find the APIs that will give us list of roles that are defined
in a process for which the user has logged in against.

Thanks again for you valuable advice.

It looks like this:

// First, retrieve the set of available roles in the process area
IRole[] availableRoles = fContext.getAvailableRoles(processArea, new
SubProgressMonitor(monitor, 500));
RolePersistence rolePersistence = new RolePersistence(availableRoles);
ITeamData teamData = processArea.getTeamData();
// Next, retrieve the encoded role-assignment data for the contributor
String roleData = RolePersistence.getPersistentRoleData(teamData,
contributor);
if (roleData != null) {
// Finally, decode the role-assignment data using the available
roles
IRole[] assignedRoles = rolePersistence.deserialize(roleData);
}



--
Jared Burns
Jazz Process Team

permanent link
Abhishek Minde (7121912) | answered Jul 25 '09, 9:32 p.m.
On Sat, 11 Jul 2009 13:53:01 +0000, abhminde wrote:
Thanks Jared. It worked.
Thanks Ryan. We tried it and it worked. It will be helpful if you can
tell me how to fetch the team members roles. We were able to fetch the
team members (contributors) from a team area. However, we are still
trying to find the APIs that will give us list of roles that are defined
in a process for which the user has logged in against.

Thanks again for you valuable advice.

It looks like this:

// First, retrieve the set of available roles in the process area
IRole[] availableRoles = fContext.getAvailableRoles(processArea, new
SubProgressMonitor(monitor, 500));
RolePersistence rolePersistence = new RolePersistence(availableRoles);
ITeamData teamData = processArea.getTeamData();
// Next, retrieve the encoded role-assignment data for the contributor
String roleData = RolePersistence.getPersistentRoleData(teamData,
contributor);
if (roleData != null) {
// Finally, decode the role-assignment data using the available
roles
IRole[] assignedRoles = rolePersistence.deserialize(roleData);
}



--
Jared Burns
Jazz Process Team

permanent link
Jared Burns (4.5k29) | answered Aug 20 '09, 8:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Thu, 20 Aug 2009 10:38:05 +0000, eclipsetalk wrote:

Hi,
I have question: how does one get the fContext in the following code
snippet:
IRole[] availableRoles =
fContext.getAvailableRoles(processArea, new SubProgressMonitor(monitor,
500));
Thanks

I don't know where that snippet is from, but it looks like a common
pattern in our code where we pass an object a "context" which gives that
object access to data and services which it would otherwise not be able
to use.

In the normal pattern, these contexts are handed out selectively. You
can't ask for one (in fact, that's usually the point of using this
pattern).

--
Jared Burns
Jazz Process Team

permanent link
Jared Burns (4.5k29) | answered Sep 22 '09, 12:40 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Tue, 22 Sep 2009 17:52:59 +0000, rose wrote:
what are the imports to execute for resolve IProjectArea in a type?

The interfaces for the process items (IProjectArea, ITeamArea, etc.) are
defined in the com.ibm.team.process.common plugin.

--
Jared Burns
Jazz Process Team

Your answer


Register or 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.