001    /**
002     * Copyright (c) 2000-2011 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.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                            Long[] assetPrimaryKey, Date dueDateGT, Date dueDateLT,
128                            Boolean completed, Boolean searchByUserRoles, boolean andOperator,
129                            int start, int end, OrderByComparator orderByComparator)
130                    throws WorkflowException;
131    
132            public List<WorkflowTask> search(
133                            long companyId, long userId, String keywords, String[] assetTypes,
134                            Boolean completed, Boolean searchByUserRoles, int start, int end,
135                            OrderByComparator orderByComparator)
136                    throws WorkflowException;
137    
138            public int searchCount(
139                            long companyId, long userId, String keywords, Boolean completed,
140                            Boolean searchByUserRoles)
141                    throws WorkflowException;
142    
143            public int searchCount(
144                            long companyId, long userId, String taskName, String assetType,
145                            Long[] assetPrimaryKey, Date dueDateGT, Date dueDateLT,
146                            Boolean completed, Boolean searchByUserRoles, boolean andOperator)
147                    throws WorkflowException;
148    
149            public int searchCount(
150                            long companyId, long userId, String keywords, String[] assetTypes,
151                            Boolean completed, Boolean searchByUserRoles)
152                    throws WorkflowException;
153    
154            public WorkflowTask updateDueDate(
155                            long companyId, long userId, long workflowTaskId, String comment,
156                            Date dueDate)
157                    throws WorkflowException;
158    
159    }