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 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<WorkflowTask> orderByComparator)
091                    throws WorkflowException;
092    
093            public List<WorkflowTask> getWorkflowTasksByRole(
094                            long companyId, long roleId, Boolean completed, int start, int end,
095                            OrderByComparator<WorkflowTask> orderByComparator)
096                    throws WorkflowException;
097    
098            public List<WorkflowTask> getWorkflowTasksBySubmittingUser(
099                            long companyId, long userId, Boolean completed, int start, int end,
100                            OrderByComparator<WorkflowTask> orderByComparator)
101                    throws WorkflowException;
102    
103            public List<WorkflowTask> getWorkflowTasksByUser(
104                            long companyId, long userId, Boolean completed, int start, int end,
105                            OrderByComparator<WorkflowTask> orderByComparator)
106                    throws WorkflowException;
107    
108            public List<WorkflowTask> getWorkflowTasksByUserRoles(
109                            long companyId, long userId, Boolean completed, int start, int end,
110                            OrderByComparator<WorkflowTask> 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<WorkflowTask> orderByComparator)
117                    throws WorkflowException;
118    
119            public List<WorkflowTask> search(
120                            long companyId, long userId, String keywords, Boolean completed,
121                            Boolean searchByUserRoles, int start, int end,
122                            OrderByComparator<WorkflowTask> 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,
130                            OrderByComparator<WorkflowTask> orderByComparator)
131                    throws WorkflowException;
132    
133            public List<WorkflowTask> search(
134                            long companyId, long userId, String keywords, String[] assetTypes,
135                            Boolean completed, Boolean searchByUserRoles, int start, int end,
136                            OrderByComparator<WorkflowTask> orderByComparator)
137                    throws WorkflowException;
138    
139            public int searchCount(
140                            long companyId, long userId, String keywords, Boolean completed,
141                            Boolean searchByUserRoles)
142                    throws WorkflowException;
143    
144            public int searchCount(
145                            long companyId, long userId, String taskName, String assetType,
146                            Long[] assetPrimaryKey, Date dueDateGT, Date dueDateLT,
147                            Boolean completed, Boolean searchByUserRoles, boolean andOperator)
148                    throws WorkflowException;
149    
150            public int searchCount(
151                            long companyId, long userId, String keywords, String[] assetTypes,
152                            Boolean completed, Boolean searchByUserRoles)
153                    throws WorkflowException;
154    
155            public WorkflowTask updateDueDate(
156                            long companyId, long userId, long workflowTaskId, String comment,
157                            Date dueDate)
158                    throws WorkflowException;
159    
160    }