001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.workflow;
016    
017    import com.liferay.portal.kernel.messaging.proxy.MessagingProxy;
018    import com.liferay.portal.kernel.messaging.proxy.ProxyMode;
019    import com.liferay.portal.kernel.util.OrderByComparator;
020    
021    import java.io.Serializable;
022    
023    import java.util.Date;
024    import java.util.List;
025    import java.util.Map;
026    
027    /**
028     * @author Micha Kiener
029     * @author Shuyang Zhou
030     * @author Brian Wing Shun Chan
031     * @author Marcellus Tavares
032     */
033    @MessagingProxy(mode = ProxyMode.SYNC)
034    public interface WorkflowTaskManager {
035    
036            public WorkflowTask assignWorkflowTaskToRole(
037                            long companyId, long userId, long workflowTaskId, long roleId,
038                            String comment, Date dueDate,
039                            Map<String, Serializable> workflowContext)
040                    throws WorkflowException;
041    
042            public WorkflowTask assignWorkflowTaskToUser(
043                            long companyId, long userId, long workflowTaskId,
044                            long assigneeUserId, String comment, Date dueDate,
045                            Map<String, Serializable> workflowContext)
046                    throws WorkflowException;
047    
048            public WorkflowTask completeWorkflowTask(
049                            long companyId, long userId, long workflowTaskId,
050                            String transitionName, String comment,
051                            Map<String, Serializable> workflowContext)
052                    throws WorkflowException;
053    
054            public List<String> getNextTransitionNames(
055                            long companyId, long userId, long workflowTaskId)
056                    throws WorkflowException;
057    
058            public long[] getPooledActorsIds(long companyId, long workflowTaskId)
059                    throws WorkflowException;
060    
061            public WorkflowTask getWorkflowTask(long companyId, long workflowTaskId)
062                    throws WorkflowException;
063    
064            public int getWorkflowTaskCount(long companyId, Boolean completed)
065                    throws WorkflowException;
066    
067            public int getWorkflowTaskCountByRole(
068                            long companyId, long roleId, Boolean completed)
069                    throws WorkflowException;
070    
071            public int getWorkflowTaskCountBySubmittingUser(
072                            long companyId, long userId, Boolean completed)
073                    throws WorkflowException;
074    
075            public int getWorkflowTaskCountByUser(
076                            long companyId, long userId, Boolean completed)
077                    throws WorkflowException;
078    
079            public int getWorkflowTaskCountByUserRoles(
080                            long companyId, long userId, Boolean completed)
081                    throws WorkflowException;
082    
083            public int getWorkflowTaskCountByWorkflowInstance(
084                            long companyId, Long userId, long workflowInstanceId,
085                            Boolean completed)
086                    throws WorkflowException;
087    
088            public List<WorkflowTask> getWorkflowTasks(
089                            long companyId, Boolean completed, int start, int end,
090                            OrderByComparator orderByComparator)
091                    throws WorkflowException;
092    
093            public List<WorkflowTask> getWorkflowTasksByRole(
094                            long companyId, long roleId, Boolean completed, int start, int end,
095                            OrderByComparator orderByComparator)
096                    throws WorkflowException;
097    
098            public List<WorkflowTask> getWorkflowTasksBySubmittingUser(
099                            long companyId, long userId, Boolean completed, int start, int end,
100                            OrderByComparator orderByComparator)
101                    throws WorkflowException;
102    
103            public List<WorkflowTask> getWorkflowTasksByUser(
104                            long companyId, long userId, Boolean completed, int start, int end,
105                            OrderByComparator orderByComparator)
106                    throws WorkflowException;
107    
108            public List<WorkflowTask> getWorkflowTasksByUserRoles(
109                            long companyId, long userId, Boolean completed, int start, int end,
110                            OrderByComparator orderByComparator)
111                    throws WorkflowException;
112    
113            public List<WorkflowTask> getWorkflowTasksByWorkflowInstance(
114                            long companyId, Long userId, long workflowInstanceId,
115                            Boolean completed, int start, int end,
116                            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    }