List of usage examples for com.liferay.portal.kernel.workflow WorkflowTaskManagerUtil completeWorkflowTask
public static WorkflowTask completeWorkflowTask(long companyId, long userId, long workflowTaskId, String transitionName, String comment, Map<String, Serializable> workflowContext) throws WorkflowException
From source file:com.liferay.calendar.test.util.CalendarWorkflowTestUtil.java
License:Open Source License
public static void completeWorkflow(Group group) throws Exception { try (CaptureAppender captureAppender = Log4JLoggerTestUtil .configureLog4JLogger("com.liferay.util.mail.MailEngine", Level.OFF)) { List<WorkflowTask> workflowTasks = WorkflowTaskManagerUtil.getWorkflowTasksByUserRoles( TestPropsValues.getCompanyId(), TestPropsValues.getUserId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); Assert.assertEquals(workflowTasks.toString(), 1, workflowTasks.size()); WorkflowTask workflowTask = workflowTasks.get(0); PermissionChecker userPermissionChecker = PermissionCheckerFactoryUtil .create(TestPropsValues.getUser()); PermissionThreadLocal.setPermissionChecker(userPermissionChecker); WorkflowTaskManagerUtil.assignWorkflowTaskToUser(group.getCompanyId(), TestPropsValues.getUserId(), workflowTask.getWorkflowTaskId(), TestPropsValues.getUserId(), StringPool.BLANK, null, null); WorkflowTaskManagerUtil.completeWorkflowTask(group.getCompanyId(), TestPropsValues.getUserId(), workflowTask.getWorkflowTaskId(), Constants.APPROVE, StringPool.BLANK, null); }//from ww w . j av a2 s . c o m }
From source file:com.liferay.portlet.workflowtasks.action.EditWorkflowTaskAction.java
License:Open Source License
protected void completeTask(ActionRequest actionRequest) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); String transitionName = ParamUtil.getString(actionRequest, "transitionName"); String comment = ParamUtil.getString(actionRequest, "comment"); WorkflowTaskManagerUtil.completeWorkflowTask(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId, transitionName, comment, null); }