1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.workflow;
16  
17  import com.liferay.portal.kernel.messaging.proxy.MessagingProxy;
18  import com.liferay.portal.kernel.messaging.proxy.ProxyMode;
19  import com.liferay.portal.kernel.util.OrderByComparator;
20  
21  import java.io.Serializable;
22  
23  import java.util.Date;
24  import java.util.List;
25  import java.util.Map;
26  
27  /**
28   * <a href="WorkflowTaskManager.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Micha Kiener
31   * @author Shuyang Zhou
32   * @author Brian Wing Shun Chan
33   * @author Marcellus Tavares
34   */
35  @MessagingProxy(mode = ProxyMode.SYNC)
36  public interface WorkflowTaskManager {
37  
38      public WorkflowTask assignWorkflowTaskToRole(
39              long companyId, long userId, long workflowTaskId, long roleId,
40              String comment, Date dueDate,
41              Map<String, Serializable> workflowContext)
42          throws WorkflowException;
43  
44      public WorkflowTask assignWorkflowTaskToUser(
45              long companyId, long userId, long workflowTaskId,
46              long assigneeUserId, String comment, Date dueDate,
47              Map<String, Serializable> workflowContext)
48          throws WorkflowException;
49  
50      public WorkflowTask completeWorkflowTask(
51              long companyId, long userId, long workflowTaskId,
52              String transitionName, String comment,
53              Map<String, Serializable> workflowContext)
54          throws WorkflowException;
55  
56      public List<String> getNextTransitionNames(
57              long companyId, long userId, long workflowTaskId)
58          throws WorkflowException;
59  
60      public long[] getPooledActorsIds(long companyId, long workflowTaskId)
61          throws WorkflowException;
62  
63      public WorkflowTask getWorkflowTask(long companyId, long workflowTaskId)
64          throws WorkflowException;
65  
66      public int getWorkflowTaskCount(long companyId, Boolean completed)
67          throws WorkflowException;
68  
69      public int getWorkflowTaskCountByRole(
70              long companyId, long roleId, Boolean completed)
71          throws WorkflowException;
72  
73      public int getWorkflowTaskCountBySubmittingUser(
74              long companyId, long userId, Boolean completed)
75          throws WorkflowException;
76  
77      public int getWorkflowTaskCountByUser(
78              long companyId, long userId, Boolean completed)
79          throws WorkflowException;
80  
81      public int getWorkflowTaskCountByUserRoles(
82              long companyId, long userId, Boolean completed)
83          throws WorkflowException;
84  
85      public int getWorkflowTaskCountByWorkflowInstance(
86              long companyId, long workflowInstanceId, Boolean completed)
87          throws WorkflowException;
88  
89      public List<WorkflowTask> getWorkflowTasks(
90              long companyId, Boolean completed, int start, int end,
91              OrderByComparator orderByComparator)
92          throws WorkflowException;
93  
94      public List<WorkflowTask> getWorkflowTasksByRole(
95              long companyId, long roleId, Boolean completed, int start, int end,
96              OrderByComparator orderByComparator)
97          throws WorkflowException;
98  
99      public List<WorkflowTask> getWorkflowTasksBySubmittingUser(
100         long companyId, long userId, Boolean completed, int start, int end,
101         OrderByComparator orderByComparator)
102     throws WorkflowException;
103 
104     public List<WorkflowTask> getWorkflowTasksByUser(
105             long companyId, long userId, Boolean completed, int start, int end,
106             OrderByComparator orderByComparator)
107         throws WorkflowException;
108 
109     public List<WorkflowTask> getWorkflowTasksByUserRoles(
110             long companyId, long userId, Boolean completed, int start, int end,
111             OrderByComparator orderByComparator)
112         throws WorkflowException;
113 
114     public List<WorkflowTask> getWorkflowTasksByWorkflowInstance(
115             long companyId, long workflowInstanceId, Boolean completed,
116             int start, int end, OrderByComparator orderByComparator)
117         throws WorkflowException;
118 
119     public List<WorkflowTask> search(
120             long companyId, long userId, String keywords,
121             Boolean completed, Boolean searchByUserRoles, int start, int end,
122             OrderByComparator orderByComparator)
123         throws WorkflowException;
124 
125     public List<WorkflowTask> search(
126             long companyId, long userId, String taskName, String assetType,
127             Date dueDateGT, Date dueDateLT, Boolean completed,
128             Boolean searchByUserRoles, boolean andOperator, int start, int end,
129             OrderByComparator orderByComparator)
130         throws WorkflowException;
131 
132     public int searchCount(
133             long companyId, long userId, String keywords, Boolean completed,
134             Boolean searchByUserRoles)
135         throws WorkflowException;
136 
137     public int searchCount(
138             long companyId, long userId, String taskName, String assetType,
139             Date dueDateGT, Date dueDateLT, Boolean completed,
140             Boolean searchByUserRoles, boolean andOperator)
141         throws WorkflowException;
142 
143     public WorkflowTask updateDueDate(
144             long companyId, long userId, long workflowTaskId, String comment,
145             Date dueDate)
146         throws WorkflowException;
147 
148 }