updateResourcePools

Purpose

This operation updates existing resource pool objects in PPM Center.

Function and Parameters

This operation returns one or more (maximum 1,000) updated resource pool objects from PPM Center according to a specified list of resource pool objects. The user performing this operation must have one of the following access grants:

  • Edit Resource Pool

  • Edit All Resource Pools

Required Fields:

  • ID

Optional Fields:

  • Name

  • Region

  • Description

  • Parent

  • Org unit

  • Manager

  • Note

  • Child

  • ACEs

Limitations

This operation has the following limitations:

  • User data cannot be created.

  • This operation assumes basic data exists in the database. The following data must exist in any production PPM Center instance:

    • Resources

    • Users

    • Parent resource pool

    • Org Unit

    • Region

    All values provided in the parameters must comply with what is expected in PPM Center. The possible values are provided above when each parameter is described.

  • If a data problem occurs with any data provided for the resource pools, the entire data set is rejected. No resource pools are created.

Related Information

createResourcePools- to create new resource pools.

Input

ResourcePool

Return

None

Java Interface

UpdateResourcePoolsResponseDocument updateResourcePools(UpdateResourcePoolsDocument in)

Parameters

Description

UpdateResourcePoolsDocument

Wrapper array of resource pool objects. (WSResourcePoolBean[])

Java Examples

Example: update a resource pool

/**
* Test updating a resource pool.
*/
public void testUpdateResourcePool(long poolId) throws
Exception {
     // query the resource pool
     ResourcePool[] resourcePools = getResourcePools(new long[]
{poolId});
     ResourcePool pool = resourcePools[0];
     // update the pool object
     pool.setDescription("New version of the pool");
     // remove existing manager
     pool.setManagerArray(new ResourceReference[0]);
     // add new manager
     pool.addNewManager().setName("user1");
     // remove note
     pool.setNoteArray(new Note[] {});
     // call the service
     updateResourcePools(new ResourcePool[] { pool} );
}
/**
* This is a wrapper method around the updateResourcePools web
service, which modifies existing resource
* pools. This method handles the details of creating the
document, invoking the web service and unwrapping
* the response.
* @param resourcePools
* The changes that should be made to existing resource pools.
Resource pools are
* identified by primary key, so the ID of each resource pool
must be non-null.
* @throws Exception
*/
void updateResourcePools(ResourcePool[] resourcePools) throws
Exception {
     ResourceServiceStub service = new ResourceServiceStub(ctx,
WSURL);
     UpdateResourcePoolsDocument updateResourcePoolsDoc =
UpdateResourcePoolsDocument.Factory.newInstance();
updateResourcePoolsDoc.addNewUpdateResourcePools().setResourceP
oolArray(resourcePools);
     service.updateResourcePools(updateResourcePoolsDoc);
}

Errors and Exceptions

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

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

error.ws.update.idrequired

When updating a resource pool you must provide the ID of the resource pool you wish to modify. The resource pool name is not sufficient.

The pending update Resource pool ID is null.

Enter the resource pool ID.

error.ws.maxResourcePools

The maximum number of resource pools to process in a single web service transaction may not exceed 1000.

The number of resource pools exceeds 1,000.

Break up the list of resource pools into smaller chunks and process over multiple transactions.

error.ws.create.duplicateName

A resource pool with the name "{0}" already exists. Enter a different name.

A resource pool with the name already exists.

Enter a different name.

error.ws.create.cycle

Cannot create resource pool as it would introduce a cyclical parent-child relationship between the resource pools {0} and {1}.

Two resource pools have each other as parents.

Make sure that the resource pools do not have each other as parents.

error.ws.regionRequired

Resource pool region is required. Specify a region for each resource pool.

The region for a resource pool is not specified.

Specify the region.

error.ws.nameRequired

Resource pool name cannot be blank. Provide a name for each resource pool.

The resource pool name is not set for a pool.

Set the resource pool name.

error.ws.descriptionTooLong

Description cannot be longer than 650 characters.

The description of a resource pool contains more than 650 characters

Reduce length of description.

error.ws.nameTooLong

Name cannot be longer than 260 characters.

The name of a resource pool is greater than 260.

Reduce length of name.

N/A

Entity Validation errors if region, manager, resource pool does not exist.

The resource pool region, manager, or parent resource pool does not exist.

Ensure that Resource pool region, manager, and parent resource pool exist for all pools to be created before this web service call.

exception.cannotLoadEntity

Cannot load the resource pool with the specified id: {1}. Resource Pool may be deleted by another user.

The resource pool does not exist.

Ensure the pending update resource pool exists.