Example usage for com.liferay.portal.kernel.workflow WorkflowTaskManagerUtil updateDueDate

List of usage examples for com.liferay.portal.kernel.workflow WorkflowTaskManagerUtil updateDueDate

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.workflow WorkflowTaskManagerUtil updateDueDate.

Prototype

public static WorkflowTask updateDueDate(long companyId, long userId, long workflowTaskId, String comment,
            Date dueDate) throws WorkflowException 

Source Link

Usage

From source file:com.liferay.portlet.workflowtasks.action.EditWorkflowTaskAction.java

License:Open Source License

protected void updateTask(ActionRequest actionRequest) throws Exception {
    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

    long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId");

    String comment = ParamUtil.getString(actionRequest, "comment");

    int dueDateMonth = ParamUtil.getInteger(actionRequest, "dueDateMonth");
    int dueDateDay = ParamUtil.getInteger(actionRequest, "dueDateDay");
    int dueDateYear = ParamUtil.getInteger(actionRequest, "dueDateYear");
    int dueDateHour = ParamUtil.getInteger(actionRequest, "dueDateHour");
    int dueDateMinute = ParamUtil.getInteger(actionRequest, "dueDateMinute");
    int dueDateAmPm = ParamUtil.getInteger(actionRequest, "dueDateAmPm");

    if (dueDateAmPm == Calendar.PM) {
        dueDateHour += 12;/*from  w  w  w  .  ja v a 2  s  . co m*/
    }

    Date dueDate = PortalUtil.getDate(dueDateMonth, dueDateDay, dueDateYear, dueDateHour, dueDateMinute,
            new WorkflowTaskDueDateException());

    WorkflowTaskManagerUtil.updateDueDate(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId,
            comment, dueDate);
}