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

Sharing project area process using the API

Is anyone aware of any server side code that cn be used to set the process of an unconfigured process project area to share it's process from another project area.
We are trying to automate project setup and are able to successfully create an unconfigured project area programmatically using the API, but are struggling to share our mast projcte areas process with it after the fact.

I think it may require us to set some ProcessConfigurationElement or possibly add some ProcessConfigurationData, but the process source configuration xml for a project we are able to do this on manually does contain any elements so we are not sure how to proceed.

Thanks in advance for any assistance

0 votes



4 answers

Permanent link
Is anyone aware of any server side code that cn be used to set the process of an unconfigured process project area to share it's process from another project area.
We are trying to automate project setup and are able to successfully create an unconfigured project area programmatically using the API, but are struggling to share our mast projcte areas process with it after the fact.

I think it may require us to set some ProcessConfigurationElement or possibly add some ProcessConfigurationData, but the process source configuration xml for a project we are able to do this on manually does contain any elements so we are not sure how to proceed.

Thanks in advance for any assistance



ProjectArea has functions setProcessProvider (used for local project area within one server) and setRemoteProcessProviderUrl (used for cross server project area) to use process from another project area. Below is an example code:


if (projectAreaParms.internalProcessProviderUUID != null) {
//local provider
if (projectAreaParms.internalProcessProviderUUID.equals(ITEMID_NONE)) {
((ProjectArea) projectArea).setProcessProvider(null);
} else {
((ProjectArea) projectArea).setProcessProvider((IProjectAreaHandle) IProjectArea.ITEM_TYPE.createItemHandle(UUID.valueOf(projectAreaParms.internalProcessProviderUUID), null));
((ProjectArea) projectArea).setRemoteProcessProviderUrl(null);
}
}
if (projectAreaParms.internalRemoteProcessProviderUrl != null) {
//remote provider
if (projectAreaParms.internalRemoteProcessProviderUrl.equals(ITEMID_NONE)) {
((ProjectArea) projectArea).setRemoteProcessProviderUrl(null);
} else {
((ProjectArea) projectArea).setRemoteProcessProviderUrl(projectAreaParms.internalRemoteProcessProviderUrl);
((ProjectArea) projectArea).setProcessProvider(null);
}
}

0 votes


Permanent link
Thanks for geting back to me so quickly on this, I'll give it a try.

0 votes


Permanent link
Unfortinately not working for me as I won;t be able to use the ProcessRestService methods.
Is there a way to do this with the client libraries as I'm running server side java via a client for this action.

0 votes


Permanent link
Have it working with the client libraries now. The getProcessProvider put me on the right track. Sample code fyi below:

IProjectArea projectArea = null;
IProjectArea parentArea = null;
ProcessProviderWorkingCopy provider = null;

ProjectAreaWorkingCopy paworkingcopy = null;
ProcessProviderWorkingCopy processcopy = null;

for (Object object : processAreas) {
processArea = (IProjectArea) object;

if (processArea.getName().equals(rtcprojectname)) {
projectArea = (IProjectArea) processArea;
paworkingcopy = (ProjectAreaWorkingCopy) service
.getWorkingCopyManager().createPrivateWorkingCopy(
processArea);
provider = paworkingcopy.getProcessProvider();

}
if (processArea.getName().equals(parentProjectName)) {
parentArea = (IProjectArea) processArea;
}

}
System.out.println("Setting project area to use process provider");
provider.setProcessProvider(parentArea);
System.out.println("Setting shared process area");
provider.setUsesProcessProvider(true);

System.out.println("Saving pa working copy");
paworkingcopy.save(monitor);

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

Question asked: Oct 26 '11, 6:52 p.m.

Question was seen: 4,915 times

Last updated: Oct 26 '11, 6:52 p.m.

Confirmation Cancel Confirm