reworkTimeSheetLine

Purpose

Rework an existing time sheet line 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 a time sheet line to be "unsubmitted" and updates the time sheet to "in-rework."

Before this operation, the status of the line must be "submitted," "approved," or "rejected."

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

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

  • Be one of the following:

    • The resource of this time sheet.

    • The delegate of the resource.

    • The manager of the resource.

An additional field this operation updates is the Actual Approver, which is set to null.

Input

A long value of the time sheet line ID.

An object of whole TimeSheetBean where this line exists.

Return

An object of TimeSheetBean, complete with all the fields.

Java Interface

ReworkTimeSheetLineResponseDocument reworkTimeSheetLine(ReworkTimeSheetLineDocument in)

Parameters

Description

ReworkTimeSheetLineDocument

Wrapper for TimeSheetBean and a long value for a time sheet line ID. See the following example for the construction.

ReworkTimeSheetLineResponseDocument

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

Java Examples

Example: rework an existing time sheet line.

public void testReworkTimeSheetLine() {
        System.out.println("testReworkTimeSheetLine started ...");
        try {
            if(createdTimeSheetBean == null)
                testSubmitTimeSheet();
TimeServiceStub stub = new TimeServiceStub(ctx, WSURL);
            ReworkTimeSheetLineDocument reworkTimeSheetLineDocument =
ReworkTimeSheetLineDocument.Factory.newInstance();
TimeSheetBean reworkTimeSheetBean =
reworkTimeSheetLineDocument.addNewReworkTimeSheetLine().addNewTimeSheetBean();
reworkTimeSheetBean.setTimeSheetId(createdTimeSheetBean.getTimeSheetId());
reworkTimeSheetBean.setResourceId(createdTimeSheetBean.getResourceId());
reworkTimeSheetBean.setPeriodId(createdTimeSheetBean.getPeriodId());
           TimeSheetStatus timeSheetStatus = reworkTimeSheetBean.addNewState();
           timeSheetStatus.setCode(new BigInteger("2"));
           timeSheetStatus.setMeaning("pending-approval");
           TimeSheetLineBean timeSheetLineBean =
reworkTimeSheetBean.addNewTimeSheetLines();
timeSheetLineBean.setTimeSheetLineId(createdTimeSheetBean.getTimeSheetLinesArr
ay(0).getTimeSheetLineId());
timeSheetLineBean.setWorkItemId(createdTimeSheetBean.getTimeSheetLinesArray(0)
.getWorkItemId());
timeSheetLineBean.setWorkItemSetId(createdTimeSheetBean.getTimeSheetLinesArray
(0).getWorkItemSetId());
timeSheetLineBean.setWorkItemType(createdTimeSheetBean.getTimeSheetLinesArray(
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});
reworkTimeSheetLineDocument.getReworkTimeSheetLine().setTimeSheetLineId(create
dTimeSheetBean.getTimeSheetLinesArray(0).getTimeSheetLineId());
            ReworkTimeSheetLineResponseDocument response =
stub.reworkTimeSheetLine(reworkTimeSheetLineDocument);
            TimeSheetBean returnTimeSheet =
response.getReworkTimeSheetLineResponse().getReturn();
            System.out.println("Time Sheet was reworked " +
returnTimeSheet.getTimeSheetId());
        }
        catch(Exception e) {
            e.printStackTrace();
        }
        System.out.println("testReworkTimeSheetLine 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.cannotReworkTimesheetLine

User cannot rework Timesheet Line

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

Check the user licenses and privileges (access grants).

ex.timesheetLineCannotbeReworked

Timesheet line is not in submitted, rejected or approved state, it cannot be reworked

You try to rework a time sheet line that is not submitted, rejected, or approved.

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

ex.timesheetLineNotExist

Timesheet line does not exist in this timesheet

Time sheet ID or line ID is invalid, database might be corrupt.

Check the validity of the time sheet ID and line ID.

ex.timesheetLineNullCannotbeReworked

Timesheet line or timesheet is null, cannot be reworked

Time sheet ID or line ID is invalid, database might be corrupt

Check the validity of the time sheet ID and line ID.

ex.tsIncorrectReworkStatus

TimeSheet line can not be reworked as timesheet status is unsubmitted

Time sheet line status is incorrect to rework.

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

ex.tslIncorrectReworkStatus

Rework can not be done on unsubmitted timesheet line

Time sheet line status is incorrect to rework.

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

ex.tsIncorrectReworkLineStatus

TimeSheet line can not be reworked as timesheet line status is {0}

Time sheet line status is incorrect to rework.

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

ex.tsReworkLineBeanIdNotMatch

There is no matching timesheet line ({0}) in timesheet bean to rework

Time sheet line ID is invalid.

Check the validity of the time sheet line ID.

ex.tsReworkLineIdNotMatch

There is no matching timesheet line ({0}) in timesheet to rework

Time sheet line ID is invalid.

Check the validity of the time sheet line ID.