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.util.OrderByComparator;
18  
19  import java.io.Serializable;
20  
21  import java.util.Date;
22  import java.util.List;
23  import java.util.Map;
24  
25  /**
26   * <a href="WorkflowTaskManagerUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Micha Kiener
29   * @author Shuyang Zhou
30   * @author Brian Wing Shun Chan
31   * @author Marcellus Tavares
32   */
33  public class WorkflowTaskManagerUtil {
34  
35      public static WorkflowTask assignWorkflowTaskToRole(
36              long companyId, long userId, long workflowTaskId, long roleId,
37              String comment, Date dueDate,
38              Map<String, Serializable> workflowContext)
39          throws WorkflowException {
40  
41          return _workflowTaskManager.assignWorkflowTaskToRole(
42              companyId, userId, workflowTaskId, roleId, comment, dueDate,
43              workflowContext);
44      }
45  
46      public static WorkflowTask assignWorkflowTaskToUser(
47              long companyId, long userId, long workflowTaskId,
48              long assigneeUserId, String comment, Date dueDate,
49              Map<String, Serializable> workflowContext)
50          throws WorkflowException {
51  
52          return _workflowTaskManager.assignWorkflowTaskToUser(
53              companyId, userId, workflowTaskId, assigneeUserId, comment, dueDate,
54              workflowContext);
55      }
56  
57      public static WorkflowTask completeWorkflowTask(
58              long companyId, long userId, long workflowTaskId,
59              String transitionName, String comment,
60              Map<String, Serializable> workflowContext)
61          throws WorkflowException {
62  
63          return _workflowTaskManager.completeWorkflowTask(
64              companyId, userId, workflowTaskId, transitionName, comment,
65              workflowContext);
66      }
67  
68      public static List<String> getNextTransitionNames(
69              long companyId, long userId, long workflowTaskId)
70          throws WorkflowException {
71  
72          return _workflowTaskManager.getNextTransitionNames(
73              companyId, userId, workflowTaskId);
74      }
75  
76      public static long[] getPooledActorsIds(long companyId, long workflowTaskId)
77          throws WorkflowException {
78  
79          return _workflowTaskManager.getPooledActorsIds(
80              companyId, workflowTaskId);
81      }
82  
83      public static WorkflowTask getWorkflowTask(
84              long companyId, long workflowTaskId)
85          throws WorkflowException {
86  
87          return _workflowTaskManager.getWorkflowTask(companyId, workflowTaskId);
88      }
89  
90      public static int getWorkflowTaskCount(long companyId, Boolean completed)
91          throws WorkflowException {
92  
93          return _workflowTaskManager.getWorkflowTaskCount(companyId, completed);
94      }
95  
96      public static int getWorkflowTaskCountByRole(
97              long companyId, long roleId, Boolean completed)
98          throws WorkflowException {
99  
100         return _workflowTaskManager.getWorkflowTaskCountByRole(
101             companyId, roleId, completed);
102     }
103 
104     public static int getWorkflowTaskCountBySubmittingUser(
105             long companyId, long userId, Boolean completed)
106         throws WorkflowException {
107 
108         return _workflowTaskManager.getWorkflowTaskCountBySubmittingUser(
109             companyId, userId, completed);
110     }
111 
112     public static int getWorkflowTaskCountByUser(
113             long companyId, long userId, Boolean completed)
114         throws WorkflowException {
115 
116         return _workflowTaskManager.getWorkflowTaskCountByUser(
117             companyId, userId, completed);
118     }
119 
120     public static int getWorkflowTaskCountByUserRoles(
121             long companyId, long userId, Boolean completed)
122         throws WorkflowException {
123 
124         return _workflowTaskManager.getWorkflowTaskCountByUserRoles(
125             companyId, userId, completed);
126     }
127 
128     public static int getWorkflowTaskCountByWorkflowInstance(
129             long companyId, long workflowInstanceId, Boolean completed)
130         throws WorkflowException {
131 
132         return _workflowTaskManager.getWorkflowTaskCountByWorkflowInstance(
133             companyId, workflowInstanceId, completed);
134     }
135 
136     public static WorkflowTaskManager getWorkflowTaskManager() {
137         return _workflowTaskManager;
138     }
139 
140     public static List<WorkflowTask> getWorkflowTasks(
141             long companyId, Boolean completed, int start, int end,
142             OrderByComparator orderByComparator)
143         throws WorkflowException {
144 
145         return _workflowTaskManager.getWorkflowTasks(
146             companyId, completed, start, end, orderByComparator);
147     }
148 
149     public static List<WorkflowTask> getWorkflowTasksByRole(
150             long companyId, long roleId, Boolean completed, int start, int end,
151             OrderByComparator orderByComparator)
152         throws WorkflowException {
153 
154         return _workflowTaskManager.getWorkflowTasksByRole(
155             companyId, roleId, completed, start, end, orderByComparator);
156     }
157 
158     public static List<WorkflowTask> getWorkflowTasksBySubmittingUser(
159             long companyId, long userId, Boolean completed, int start, int end,
160             OrderByComparator orderByComparator)
161         throws WorkflowException {
162 
163         return _workflowTaskManager.getWorkflowTasksBySubmittingUser(
164             companyId, userId, completed, start, end, orderByComparator);
165     }
166 
167     public static List<WorkflowTask> getWorkflowTasksByUser(
168             long companyId, long userId, Boolean completed, int start, int end,
169             OrderByComparator orderByComparator)
170         throws WorkflowException {
171 
172         return _workflowTaskManager.getWorkflowTasksByUser(
173             companyId, userId, completed, start, end, orderByComparator);
174     }
175 
176     public static List<WorkflowTask> getWorkflowTasksByUserRoles(
177             long companyId, long userId, Boolean completed, int start, int end,
178             OrderByComparator orderByComparator)
179         throws WorkflowException {
180 
181         return _workflowTaskManager.getWorkflowTasksByUserRoles(
182             companyId, userId, completed, start, end, orderByComparator);
183     }
184 
185     public static List<WorkflowTask> getWorkflowTasksByWorkflowInstance(
186             long companyId, long workflowInstanceId, Boolean completed,
187             int start, int end, OrderByComparator orderByComparator)
188         throws WorkflowException {
189 
190         return _workflowTaskManager.getWorkflowTasksByWorkflowInstance(
191             companyId, workflowInstanceId, completed, start, end,
192             orderByComparator);
193     }
194 
195     public static List<WorkflowTask> search(
196             long companyId, long userId, String keywords, Boolean completed,
197             Boolean searchByUserRoles, int start, int end,
198             OrderByComparator orderByComparator)
199         throws WorkflowException {
200 
201         return _workflowTaskManager.search(
202             companyId, userId, keywords, completed, searchByUserRoles, start,
203             end, orderByComparator);
204     }
205 
206     public static List<WorkflowTask> search(
207             long companyId, long userId, String taskName, String assetType,
208             Date dueDateGT, Date dueDateLT, Boolean completed,
209             Boolean searchByUserRoles, boolean andOperator, int start, int end,
210             OrderByComparator orderByComparator)
211         throws WorkflowException {
212 
213         return _workflowTaskManager.search(
214             companyId, userId, taskName, assetType, dueDateGT, dueDateLT,
215             completed, searchByUserRoles, andOperator, start, end,
216             orderByComparator);
217     }
218 
219     public static int searchCount(
220             long companyId, long userId, String keywords, Boolean completed,
221             Boolean searchByUserRoles)
222         throws WorkflowException {
223 
224         return _workflowTaskManager.searchCount(
225             companyId, userId, keywords, completed, searchByUserRoles);
226     }
227 
228     public static int searchCount(
229         long companyId, long userId, String taskName, String assetType,
230             Date dueDateGT, Date dueDateLT, Boolean completed,
231             Boolean searchByUserRoles, boolean andOperator)
232         throws WorkflowException {
233 
234         return _workflowTaskManager.searchCount(
235             companyId, userId, taskName, assetType, dueDateGT, dueDateLT,
236             completed, searchByUserRoles, andOperator);
237     }
238 
239     public static WorkflowTask updateDueDate(
240             long companyId, long userId, long workflowTaskId, String comment,
241             Date dueDate)
242         throws WorkflowException {
243 
244         return _workflowTaskManager.updateDueDate(
245             companyId, userId, workflowTaskId, comment, dueDate);
246     }
247 
248     public void setWorkflowTaskManager(
249         WorkflowTaskManager workflowTaskManager) {
250 
251         _workflowTaskManager = workflowTaskManager;
252     }
253 
254     private static WorkflowTaskManager _workflowTaskManager;
255 
256 }