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

about project area and process template

Hi all,
My code tries to retrieve project area of a sharable object (such as a shared java file). When the process template of the project area is openup, it works just fine. But when the process template is simple team process template, it just couldn't find the project area.

Below is my code.

IProjectAreaHandle prjArea = null;

ISharingDescriptor shareDesc = shareable.getShare(null)
.getSharingDescriptor();
IWorkspaceHandle workspaceHandle = (IWorkspaceHandle)shareDesc.getConnectionHandle();


ITeamRepository repos = getTeamRepository(shareDesc);
IItemManager im = repos.itemManager();

IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(repos);
IWorkspaceConnection workspaceConnection = workspaceManager.getWorkspaceConnection(workspaceHandle, null);

IFlowEntry currentFlowEntry = workspaceConnection.getFlowTable().getCurrentDeliverFlow();
if (currentFlowEntry != null) {

IWorkspaceHandle targetHandle = (IWorkspaceHandle) currentFlowEntry.getFlowNode();
IWorkspaceConnection targetConnection = workspaceManager.getWorkspaceConnection(targetHandle, null);
if (targetConnection.isStream()) {
IAuditableHandle ownerHandle = targetConnection.getOwner();
ITeamArea teamArea = (ITeamArea) im.fetchCompleteItem((ITeamAreaHandle)ownerHandle, IItemManager.DEFAULT, null);
prjArea = teamArea.getProjectArea();

}
}


So, what is the problem of this? I hope the code works in any template.

0 votes



2 answers

Permanent link
Hi all,
My code tries to retrieve project area of a sharable object (such as a shared java file). When the process template of the project area is openup, it works just fine. But when the process template is simple team process template, it just couldn't find the project area.

Below is my code.

IProjectAreaHandle prjArea = null;

ISharingDescriptor shareDesc = shareable.getShare(null)
.getSharingDescriptor();
IWorkspaceHandle workspaceHandle = (IWorkspaceHandle)shareDesc.getConnectionHandle();


ITeamRepository repos = getTeamRepository(shareDesc);
IItemManager im = repos.itemManager();

IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(repos);
IWorkspaceConnection workspaceConnection = workspaceManager.getWorkspaceConnection(workspaceHandle, null);

IFlowEntry currentFlowEntry = workspaceConnection.getFlowTable().getCurrentDeliverFlow();
if (currentFlowEntry != null) {

IWorkspaceHandle targetHandle = (IWorkspaceHandle) currentFlowEntry.getFlowNode();
IWorkspaceConnection targetConnection = workspaceManager.getWorkspaceConnection(targetHandle, null);
if (targetConnection.isStream()) {
IAuditableHandle ownerHandle = targetConnection.getOwner();
ITeamArea teamArea = (ITeamArea) im.fetchCompleteItem((ITeamAreaHandle)ownerHandle, IItemManager.DEFAULT, null);
prjArea = teamArea.getProjectArea();

}
}


So, what is the problem of this? I hope the code works in any template.


Hi,

Can you please provide more details on where exactly your code fails?

Thanks
Sridevi
Jazz Process Team.

0 votes


Permanent link
On Mon, 21 Dec 2009 06:52:51 +0000, luyaoben wrote:

Hi all,
My code tries to retrieve project area of a sharable object (such as a
shared java file). When the process template of the project area is
openup, it works just fine. But when the process template is simple team
process template, it just couldn't find the project area.

Below is my code.

IProjectAreaHandle prjArea = null;

ISharingDescriptor shareDesc = shareable.getShare
(null)
.getSharingDescriptor();
IWorkspaceHandle workspaceHandle =
(IWorkspaceHandle)shareDesc.getConnectionHandle();


ITeamRepository repos = getTeamRepository
(shareDesc); IItemManager im
= repos.itemManager();

IWorkspaceManager workspaceManager =
SCMPlatform.getWorkspaceManager(repos);
IWorkspaceConnection workspaceConnection =
workspaceManager.getWorkspaceConnection(workspaceHandle, null);

IFlowEntry currentFlowEntry =
workspaceConnection.getFlowTable().getCurrentDeliverFlow();

if (currentFlowEntry != null) {

IWorkspaceHandle targetHandle = (IWorkspaceHandle)
currentFlowEntry.getFlowNode();
IWorkspaceConnection targetConnection =
workspaceManager.getWorkspaceConnection(targetHandle, null);
if (targetConnection.isStream()) {
IAuditableHandle ownerHandle =
targetConnection.getOwner();
ITeamArea teamArea = (ITeamArea)
im.fetchCompleteItem((ITeamAreaHandle)ownerHandle, IItemManager.DEFAULT,
null);
prjArea = teamArea.getProjectArea();

}
}


So, what is the problem of this? I hope the code works in any template.

Looks like your code is casting the "ownerHandle" to an ITeamAreaHandle.
I believe SCM allows the stream owner to be either a team area or a
project area. Your code is probably failing because the new Scrum
template creates a stream that is owned by a project area.

Change your code to cast the ownerHandle to IProcessArea instead. Might
want to throw in an instanceof check for good measure, since I think the
owner can also be an IContributor.

--
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,938

Question asked: Dec 21 '09, 1:49 a.m.

Question was seen: 5,900 times

Last updated: Dec 21 '09, 1:49 a.m.

Confirmation Cancel Confirm