updatePortfolio

Purpose

This operation updates the portfolio header details (name, set of managers) for a portfolio.

Function

You can use this operation to update the name or the managers of a portfolio.

Limitations

When the input data contains a list of portfolio managers, the existing list of managers is replaced with the list that you specify in the input of this operation. This means, the operation does not add new managers to the original list or delete existing managers from the original list. This has to be done by specifying a new list of managers for the portfolio.

Related Information

The following related operation:

Input

This operation requires the following input:

  • The portfolio ID

  • A new set of managers and/or the new name of the portfolio

Return

A PortfolioWSBean object with the ID, name and managers fields populated.

Java Interface

UpdatePortfolioResponseDocument updatePortfolio (UpdatePortfolioDocument in)

Parameters

Description

UpdatePortfolioDocument

Wrapper for PortfolioWSBean array.

See the Java example for construction.

The following fields in the bean are required:

  • Long id

  • String name and /or String[] managers

Java Examples

public Portfolio testUpdatePortfolio(long portfolioId, String
portfolioName, String[] managers) throws Exception {
       System.out.println("testUpdatePortfolio started ...");
       PortfolioServiceStub stub = new PortfolioServiceStub(ctx,
WSURL);
       UpdatePortfolioDocument updatePortfolioDocument =
UpdatePortfolioDocument.Factory.newInstance();
       final UpdatePortfolioInput updatePortfolio =
updatePortfolioDocument.addNewUpdatePortfolio().addNewUpdatePor
tfolio();
       updatePortfolio.setId(portfolioId);
       updatePortfolio.setName(portfolioName);
       updatePortfolio.setManagerUserNameArray(managers);
       UpdatePortfolioResponseDocument response =
stub.updatePortfolio(updatePortfolioDocument);
       Portfolio updatedPortfolio =
response.getUpdatePortfolioResponse().getUpdatePortfolio();
       System.out.println("Updated Portfolio " + portfolioName +
" with id " + updatedPortfolio.getId());
       System.out.println("testUpdatePortfolio completed");
       return updatedPortfolio;
}

Errors and Exceptions

When an error occurs on this operation, you will see a description of the root cause in the server log or in the response message:

The server log content is similar to the following:

Exception in thread "main" org.apache.axis2.AxisFault:
<exception:exceptionDetails xmlns:exception="http://
www.mercury.com/ppm/ws/exception">
<exception:detail>[root cause description] </exception:detail>
</exception:exceptionDetails>

Possible root cause descriptions:

Message Code

Message

Cause(s)

Possible Corrective Action

exception.authorization

You do not have the privilege to take this action. Please consult your PPM Administrator.

You are not authorized to create a portfolio.

Check the user licenses and privileges (access grants)

com.mercury.itg.pfm.service.PFMDataValidationException

Portfolio Name already exists.

A portfolio with the specified name already exists.

Change the portfolio name.

com.mercury.itg.pfm.service.PFMDataValidationException

One or more of the portfolio managers do not exist in PPM

One or more of the specified usernames do not exist in PPM Center.

Check the usernames.