001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.workflow;
016    
017    import com.liferay.portal.kernel.util.OrderByComparator;
018    
019    import java.io.Serializable;
020    
021    import java.util.Date;
022    import java.util.List;
023    import java.util.Map;
024    
025    /**
026     * @author Micha Kiener
027     * @author Shuyang Zhou
028     * @author Brian Wing Shun Chan
029     * @author Marcellus Tavares
030     */
031    public class WorkflowTaskManagerUtil {
032    
033            public static WorkflowTask assignWorkflowTaskToRole(
034                            long companyId, long userId, long workflowTaskId, long roleId,
035                            String comment, Date dueDate,
036                            Map<String, Serializable> workflowContext)
037                    throws WorkflowException {
038    
039                    return _workflowTaskManager.assignWorkflowTaskToRole(
040                            companyId, userId, workflowTaskId, roleId, comment, dueDate,
041                            workflowContext);
042            }
043    
044            public static WorkflowTask assignWorkflowTaskToUser(
045                            long companyId, long userId, long workflowTaskId,
046                            long assigneeUserId, String comment, Date dueDate,
047                            Map<String, Serializable> workflowContext)
048                    throws WorkflowException {
049    
050                    return _workflowTaskManager.assignWorkflowTaskToUser(
051                            companyId, userId, workflowTaskId, assigneeUserId, comment, dueDate,
052                            workflowContext);
053            }
054    
055            public static WorkflowTask completeWorkflowTask(
056                            long companyId, long userId, long workflowTaskId,
057                            String transitionName, String comment,
058                            Map<String, Serializable> workflowContext)
059                    throws WorkflowException {
060    
061                    return _workflowTaskManager.completeWorkflowTask(
062                            companyId, userId, workflowTaskId, transitionName, comment,
063                            workflowContext);
064            }
065    
066            public static List<String> getNextTransitionNames(
067                            long companyId, long userId, long workflowTaskId)
068                    throws WorkflowException {
069    
070                    return _workflowTaskManager.getNextTransitionNames(
071                            companyId, userId, workflowTaskId);
072            }
073    
074            public static long[] getPooledActorsIds(long companyId, long workflowTaskId)
075                    throws WorkflowException {
076    
077                    return _workflowTaskManager.getPooledActorsIds(
078                            companyId, workflowTaskId);
079            }
080    
081            public static WorkflowTask getWorkflowTask(
082                            long companyId, long workflowTaskId)
083                    throws WorkflowException {
084    
085                    return _workflowTaskManager.getWorkflowTask(companyId, workflowTaskId);
086            }
087    
088            public static int getWorkflowTaskCount(long companyId, Boolean completed)
089                    throws WorkflowException {
090    
091                    return _workflowTaskManager.getWorkflowTaskCount(companyId, completed);
092            }
093    
094            public static int getWorkflowTaskCountByRole(
095                            long companyId, long roleId, Boolean completed)
096                    throws WorkflowException {
097    
098                    return _workflowTaskManager.getWorkflowTaskCountByRole(
099                            companyId, roleId, completed);
100            }
101    
102            public static int getWorkflowTaskCountBySubmittingUser(
103                            long companyId, long userId, Boolean completed)
104                    throws WorkflowException {
105    
106                    return _workflowTaskManager.getWorkflowTaskCountBySubmittingUser(
107                            companyId, userId, completed);
108            }
109    
110            public static int getWorkflowTaskCountByUser(
111                            long companyId, long userId, Boolean completed)
112                    throws WorkflowException {
113    
114                    return _workflowTaskManager.getWorkflowTaskCountByUser(
115                            companyId, userId, completed);
116            }
117    
118            public static int getWorkflowTaskCountByUserRoles(
119                            long companyId, long userId, Boolean completed)
120                    throws WorkflowException {
121    
122                    return _workflowTaskManager.getWorkflowTaskCountByUserRoles(
123                            companyId, userId, completed);
124            }
125    
126            public static int getWorkflowTaskCountByWorkflowInstance(
127                            long companyId, Long userId, long workflowInstanceId,
128                            Boolean completed)
129                    throws WorkflowException {
130    
131                    return _workflowTaskManager.getWorkflowTaskCountByWorkflowInstance(
132                            companyId, userId, workflowInstanceId, completed);
133            }
134    
135            public static WorkflowTaskManager getWorkflowTaskManager() {
136                    return _workflowTaskManager;
137            }
138    
139            public static List<WorkflowTask> getWorkflowTasks(
140                            long companyId, Boolean completed, int start, int end,
141                            OrderByComparator orderByComparator)
142                    throws WorkflowException {
143    
144                    return _workflowTaskManager.getWorkflowTasks(
145                            companyId, completed, start, end, orderByComparator);
146            }
147    
148            public static List<WorkflowTask> getWorkflowTasksByRole(
149                            long companyId, long roleId, Boolean completed, int start, int end,
150                            OrderByComparator orderByComparator)
151                    throws WorkflowException {
152    
153                    return _workflowTaskManager.getWorkflowTasksByRole(
154                            companyId, roleId, completed, start, end, orderByComparator);
155            }
156    
157            public static List<WorkflowTask> getWorkflowTasksBySubmittingUser(
158                            long companyId, long userId, Boolean completed, int start, int end,
159                            OrderByComparator orderByComparator)
160                    throws WorkflowException {
161    
162                    return _workflowTaskManager.getWorkflowTasksBySubmittingUser(
163                            companyId, userId, completed, start, end, orderByComparator);
164            }
165    
166            public static List<WorkflowTask> getWorkflowTasksByUser(
167                            long companyId, long userId, Boolean completed, int start, int end,
168                            OrderByComparator orderByComparator)
169                    throws WorkflowException {
170    
171                    return _workflowTaskManager.getWorkflowTasksByUser(
172                            companyId, userId, completed, start, end, orderByComparator);
173            }
174    
175            public static List<WorkflowTask> getWorkflowTasksByUserRoles(
176                            long companyId, long userId, Boolean completed, int start, int end,
177                            OrderByComparator orderByComparator)
178                    throws WorkflowException {
179    
180                    return _workflowTaskManager.getWorkflowTasksByUserRoles(
181                            companyId, userId, completed, start, end, orderByComparator);
182            }
183    
184            public static List<WorkflowTask> getWorkflowTasksByWorkflowInstance(
185                            long companyId, Long userId, long workflowInstanceId,
186                            Boolean completed, int start, int end,
187                            OrderByComparator orderByComparator)
188                    throws WorkflowException {
189    
190                    return _workflowTaskManager.getWorkflowTasksByWorkflowInstance(
191                            companyId, userId, 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    }