freezeTimeSheet

Purpose

Freeze an existing time sheet object in PPM Center.

Note: This operation supports the Day in Days option and Period in Days option, which were introduced since PPM Center version 8.00 Service Pack 1. For more information, see the Time Sheet Update Service section in Project and Portfolio Management Center Version 8.00.01 (Service Pack 1) Release Notes.

Function

This operation updates the status of all the lines of an existing time sheet, and the status of the time sheet to "frozen."

Before this operation, the status of the time sheet must be "approved." After this operation, only the closeTimeSheet operation is permitted.

The user performing this operation must have the permission to freeze this particular time sheet, meaning that the user must meet the following conditions:

  • Have the Time Mgmt: Edit Time Sheets access grant.

  • Be one of the following:

    • The billing approver of the time sheet.

    • The delegate of the billing approver.

Input

An object of whole TimeSheetBean to freeze.

Return

An object of TimeSheetBean, with all the fields completed.

Java Interface

FreezeTimeSheetResponseDocument freezeTimeSheet(FreezeTimeSheetDocument in)

Parameters

Description

FreezeTimeSheetDocument

Wrapper for TimeSheetBean. See the following example for the construction.

FreezeTimeSheetResponseDocument

Wrapper for TimeSheetBean. See the following example on how to retrieve the bean.

Java Examples

Example: freeze an existing time sheet

TimeSheetBean createdTimeSheetBean = null;
    public void testFreezeTimeSheet() {
        System.out.println("testFreezeTimeSheet started ...");
        try {
            if(createdTimeSheetBean == null)
                testApproveTimeSheetAllApproved();
            TimeServiceStub stub = new TimeServiceStub(ctx,
WSURL);
            FreezeTimeSheetDocument freezeTimeSheetDocument =
FreezeTimeSheetDocument.Factory.newInstance();
            TimeSheetBean freezeTimeSheetBean =
freezeTimeSheetDocument.addNewFreezeTimeSheet().addNewTimeSheet
Bean();
freezeTimeSheetBean.setTimeSheetId(createdTimeSheetBean.getTime
SheetId());
freezeTimeSheetBean.setResourceId(createdTimeSheetBean.getResou
rceId());
freezeTimeSheetBean.setPeriodId(createdTimeSheetBean.getPeriodI
d());
           TimeSheetStatus timeSheetStatus =
freezeTimeSheetBean.addNewState();
           timeSheetStatus.setCode(new BigInteger("4"));
           timeSheetStatus.setMeaning("approved");
           TimeSheetLineBean timeSheetLineBean =
freezeTimeSheetBean.addNewTimeSheetLines();
timeSheetLineBean.setTimeSheetLineId(createdTimeSheetBean.getTi
meSheetLinesArray(0).getTimeSheetLineId());
timeSheetLineBean.setWorkItemId(createdTimeSheetBean.getTimeShe
etLinesArray(0).getWorkItemId());
timeSheetLineBean.setWorkItemSetId(createdTimeSheetBean.getTime
SheetLinesArray(0).getWorkItemSetId());
timeSheetLineBean.setWorkItemType(createdTimeSheetBean.getTimeS
heetLinesArray(0).getWorkItemType());
           TimeActualsBean timeActualsBean1 =
timeSheetLineBean.addNewTimeActualsList();
           timeActualsBean1.setTotalsFlag(true);
           timeActualsBean1.setEffortsListArray(new double[]
{1,2,3,4,5,0,0,1,2,3,4,5,0,0,10});
           TimeActualsBean timeActualsBean2 =
timeSheetLineBean.addNewTimeActualsList();
           timeActualsBean2.setTotalsFlag(false);
           timeActualsBean2.setEffortsListArray(new double[]
{1,2,3,4,5,0,0,1,2,3,4,5,0,0,10});
           FreezeTimeSheetResponseDocument response =
stub.freezeTimeSheet(freezeTimeSheetDocument);
           TimeSheetBean returnTimeSheet =
response.getFreezeTimeSheetResponse().getReturn();
           System.out.println("Time Sheet was frozen " +
returnTimeSheet.getTimeSheetId());
        }
        catch(Exception e) {
            e.printStackTrace();
        }
        System.out.println("testFreezeTimeSheet completed");
    }

Errors and Exceptions

When an error occurs on this operation, you will receive 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: [root cause description]

Response message:

<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

ex.cannotFreezeTimesheet

User cannot freeze Timesheet

You may not have the required access grant or Time Management License.

Check the user licenses and privileges (access grants).

ex.timesheetCannotbeFrozen

Timesheet is not in approved state, it cannot be frozen

You try to freeze a time sheet that is not approved.

Check the state of the time sheet that you are trying to freeze.

ex.timesheetNullCannotbeFrozen

Timesheet is null, cannot be frozen

Time sheet ID is invalid, database might be corrupt.

Check the validity of the time sheet ID.

ex.tsIncorrectFreezeStatus

This timesheet can not be frozen as timesheet status is {0}

Time sheet line status is incorrect to freeze.

Perform the getTimeSheet operation to check the time sheet line status, and then perform other appropriate operations.