setResourceParticipation

Purpose

This operation sets the participation of resources in various resource pools.

Function and Parameters

This operation takes an array of (maximum 1,000) resource participation objects to set the participation of resources in different resource pools. The user performing this operation must have one of the following access grants:

  • Edit Resource Pools

  • Edit All Resource Pools

The start date of each resource distribution group in the same participation must be unique.

The sum of percentages in each resource distribution group must be in the range of 0 to 100.

Resource distribution group start date cannot be outside the range of resource start and end date in PPM Center.

Each resource distribution group may contain at most one distribution per resource pool.

Required Fields:

Optional Fields: None

Limitations

Up to 1,000 resource participation objects can pass in a single invocation.

Related Information

getResourceParticipation - to get resource participations.

Input

ResourceParticipation

Return

None

Java Interface

SetResourceParticipationResponseDocument setResourceParticipation (SetResourceParticipationDocument in)

Parameters

Description

SetResourceParticipationDocument

Wrapper array of resource participations. (ResourceParticipationBean[])

Java Examples

Example: set resource participation

/**
    * Test creating a resource participation for a resource and
then modifying it.
     */
    public void testSetResourceParticipation() throws Exception
{
        String resource = "user1";
        // create participation object
        ResourceParticipation p =
ResourceParticipation.Factory.newInstance();
        p.addNewResource().setName(resource);
    ResourceDistributionGroup group1 =
ResourceDistributionGroup.Factory.newInstance();
        group1.setStart(calendar("Jan 1, 2005"));
        group1.setDistributionArray(new
ResourcePoolDistribution[] {
                createDistribution("TestResourcePool1", 25),
                createDistribution("TestResourcePool2", 50)
        });
    ResourceDistributionGroup group2 =
ResourceDistributionGroup.Factory.newInstance();
        group2.setStart(calendar("Jan 1, 2006"));
        group2.setDistributionArray(new
ResourcePoolDistribution[] {
                createDistribution("TestResourcePool1", 5)
         });
     ResourceDistributionGroup group3 =
ResourceDistributionGroup.Factory.newInstance();
        group3.setStart(calendar("Jan 1, 2007"));
        group3.setDistributionArray(new
ResourcePoolDistribution[] {
                createDistribution("TestResourcePool1", 90),
                createDistribution("TestResourcePool2", 10)
        });
        p.setDistributionGroupArray(new
ResourceDistributionGroup[] { group1, group2, group3 });
        // call service
        setResourceParticipation(new ResourceParticipation[] { p
});
     }
     /**
     * This is a wrapper method around the
setResourceParticipation web service, which manages the
participation of
     * resources in resource pools. This method handles the
details of creating the document, invoking the web service
     * and unwrapping the response.
     *
     * @param participation Zero or more ResourceParticipation
objects, which encapsulate the participation details
     * for a resource.
     * @throws Exception
     */
    public void
setResourceParticipation(ResourceParticipation[] participation)
throws Exception {
        ResourceServiceStub service = new
ResourceServiceStub(ctx, WSURL);
    SetResourceParticipationDocument setParticipationDoc =
SetResourceParticipationDocument.Factory.newInstance();
setParticipationDoc.addNewSetResourceParticipation().setResourc
eParticipationArray(participation);
        service.setResourceParticipation(setParticipationDoc);
     }

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.

The server log file 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

error.ws.participation.badPercent

The resource distribution group with start date {0} for resource {1} has an invalid total percentage. The sum of percentages in each group must be in the range 0 to 100

The sum of percentages in the resource distribution group exceeds 100.

Ensure the sum of percentages is between 0 and 100.

error.ws.participation.duplicateStartDate

Duplicate start date: {0}. The start date of each resource distribution group in the same participation should be unique.

The start date of each resource distribution group in the same participation is not unique.

The start date of each resource distribution group in the same participation should be unique.

error.ws.participation.duplicateDistribution

The resource distribution group with start date {0} for the resource {1} has multiple distributions for the same resource pool. Each group may contain at most one distribution per resource pool.

The resource distribution group with start date {0} for the resource {1} has multiple distributions for the same resource pool.

Each group may contain at most one distribution per resource pool.

error.ws.participation.resourceUnavailable

The PPM start or end date of the resource {0} makes the resource unable to participate in a distribution group that starts on {1}.

Distribution group start date is outside the range of the resource start and end date in PPM Center.

Adjust either the start and end date for the resource in PPM Center or the distribution group start date.

exception.authorization

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

You do not have the required access grants for this operation.

Verify that your account has the required access grants.