001    /**
002     * Copyright (c) 2000-present 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 WorkflowTask fetchWorkflowTask(
055                            long companyId, long workflowTaskInstanceId)
056                    throws WorkflowException;
057    
058            public List<String> getNextTransitionNames(
059                            long companyId, long userId, long workflowTaskId)
060                    throws WorkflowException;
061    
062            public long[] getPooledActorsIds(long companyId, long workflowTaskId)
063                    throws WorkflowException;
064    
065            public WorkflowTask getWorkflowTask(long companyId, long workflowTaskId)
066                    throws WorkflowException;
067    
068            public int getWorkflowTaskCount(long companyId, Boolean completed)
069                    throws WorkflowException;
070    
071            public int getWorkflowTaskCountByRole(
072                            long companyId, long roleId, Boolean completed)
073                    throws WorkflowException;
074    
075            public int getWorkflowTaskCountBySubmittingUser(
076                            long companyId, long userId, Boolean completed)
077                    throws WorkflowException;
078    
079            public int getWorkflowTaskCountByUser(
080                            long companyId, long userId, Boolean completed)
081                    throws WorkflowException;
082    
083            public int getWorkflowTaskCountByUserRoles(
084                            long companyId, long userId, Boolean completed)
085                    throws WorkflowException;
086    
087            public int getWorkflowTaskCountByWorkflowInstance(
088                            long companyId, Long userId, long workflowInstanceId,
089                            Boolean completed)
090                    throws WorkflowException;
091    
092            public List<WorkflowTask> getWorkflowTasks(
093                            long companyId, Boolean completed, int start, int end,
094                            OrderByComparator<WorkflowTask> orderByComparator)
095                    throws WorkflowException;
096    
097            public List<WorkflowTask> getWorkflowTasksByRole(
098                            long companyId, long roleId, Boolean completed, int start, int end,
099                            OrderByComparator<WorkflowTask> orderByComparator)
100                    throws WorkflowException;
101    
102            public List<WorkflowTask> getWorkflowTasksBySubmittingUser(
103                            long companyId, long userId, Boolean completed, int start, int end,
104                            OrderByComparator<WorkflowTask> orderByComparator)
105                    throws WorkflowException;
106    
107            public List<WorkflowTask> getWorkflowTasksByUser(
108                            long companyId, long userId, Boolean completed, int start, int end,
109                            OrderByComparator<WorkflowTask> orderByComparator)
110                    throws WorkflowException;
111    
112            public List<WorkflowTask> getWorkflowTasksByUserRoles(
113                            long companyId, long userId, Boolean completed, int start, int end,
114                            OrderByComparator<WorkflowTask> orderByComparator)
115                    throws WorkflowException;
116    
117            public List<WorkflowTask> getWorkflowTasksByWorkflowInstance(
118                            long companyId, Long userId, long workflowInstanceId,
119                            Boolean completed, int start, int end,
120                            OrderByComparator<WorkflowTask> orderByComparator)
121                    throws WorkflowException;
122    
123            public List<WorkflowTask> search(
124                            long companyId, long userId, String keywords, Boolean completed,
125                            Boolean searchByUserRoles, int start, int end,
126                            OrderByComparator<WorkflowTask> orderByComparator)
127                    throws WorkflowException;
128    
129            public List<WorkflowTask> search(
130                            long companyId, long userId, String taskName, String assetType,
131                            Long[] assetPrimaryKey, Date dueDateGT, Date dueDateLT,
132                            Boolean completed, Boolean searchByUserRoles, boolean andOperator,
133                            int start, int end,
134                            OrderByComparator<WorkflowTask> orderByComparator)
135                    throws WorkflowException;
136    
137            public List<WorkflowTask> search(
138                            long companyId, long userId, String keywords, String[] assetTypes,
139                            Boolean completed, Boolean searchByUserRoles, int start, int end,
140                            OrderByComparator<WorkflowTask> orderByComparator)
141                    throws WorkflowException;
142    
143            public int searchCount(
144                            long companyId, long userId, String keywords, Boolean completed,
145                            Boolean searchByUserRoles)
146                    throws WorkflowException;
147    
148            public int searchCount(
149                            long companyId, long userId, String taskName, String assetType,
150                            Long[] assetPrimaryKey, Date dueDateGT, Date dueDateLT,
151                            Boolean completed, Boolean searchByUserRoles, boolean andOperator)
152                    throws WorkflowException;
153    
154            public int searchCount(
155                            long companyId, long userId, String keywords, String[] assetTypes,
156                            Boolean completed, Boolean searchByUserRoles)
157                    throws WorkflowException;
158    
159            public WorkflowTask updateDueDate(
160                            long companyId, long userId, long workflowTaskId, String comment,
161                            Date dueDate)
162                    throws WorkflowException;
163    
164    }