It's all about the answers!

Ask a question

Sharing project area process using the API


Kelly Anakwe (6198) | asked Oct 26 '11, 6:52 p.m.
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

4 answers



permanent link
shaomin xing (15643) | answered Oct 27 '11, 1:05 a.m.
JAZZ DEVELOPER
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);
}
}

permanent link
Kelly Anakwe (6198) | answered Oct 27 '11, 4:44 a.m.
Thanks for geting back to me so quickly on this, I'll give it a try.

permanent link
Kelly Anakwe (6198) | answered Oct 27 '11, 7:37 a.m.
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.

permanent link
Kelly Anakwe (6198) | answered Oct 27 '11, 10:29 a.m.
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);

Your answer


Register or to post your answer.