Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

APIs for Process information

Hi,

What services (APIs) can give information about process?

Thank you.

Regards,
Abhishek

0 votes



8 answers

Permanent link
You'll need to be more specific.

What product/version are you using?

Are you running in the eclipse client or server side?

0 votes


Permanent link
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?

0 votes


Permanent link
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());
}

0 votes


Permanent link
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());
}

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes


Permanent link
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

0 votes

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: May 26 '09, 5:42 p.m.

Question was seen: 8,083 times

Last updated: May 26 '09, 5:42 p.m.

Confirmation Cancel Confirm