001    /**
002     * Copyright (c) 2000-2013 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.List;
024    import java.util.Map;
025    
026    /**
027     * @author Micha Kiener
028     * @author Shuyang Zhou
029     * @author Brian Wing Shun Chan
030     * @author Marcellus Tavares
031     */
032    @MessagingProxy(mode = ProxyMode.SYNC)
033    public interface WorkflowInstanceManager {
034    
035            public void deleteWorkflowInstance(long companyId, long workflowInstanceId)
036                    throws WorkflowException;
037    
038            public List<String> getNextTransitionNames(
039                            long companyId, long userId, long workflowInstanceId)
040                    throws WorkflowException;
041    
042            public WorkflowInstance getWorkflowInstance(
043                            long companyId, long workflowInstanceId)
044                    throws WorkflowException;
045    
046            public int getWorkflowInstanceCount(
047                            long companyId, Long userId, String assetClassName,
048                            Long assetClassPK, Boolean completed)
049                    throws WorkflowException;
050    
051            public int getWorkflowInstanceCount(
052                            long companyId, Long userId, String[] assetClassNames,
053                            Boolean completed)
054                    throws WorkflowException;
055    
056            public int getWorkflowInstanceCount(
057                            long companyId, String workflowDefinitionName,
058                            Integer workflowDefinitionVersion, Boolean completed)
059                    throws WorkflowException;
060    
061            public List<WorkflowInstance> getWorkflowInstances(
062                            long companyId, Long userId, String assetClassName,
063                            Long assetClassPK, Boolean completed, int start, int end,
064                            OrderByComparator orderByComparator)
065                    throws WorkflowException;
066    
067            public List<WorkflowInstance> getWorkflowInstances(
068                            long companyId, Long userId, String[] assetClassNames,
069                            Boolean completed, int start, int end,
070                            OrderByComparator orderByComparator)
071                    throws WorkflowException;
072    
073            public List<WorkflowInstance> getWorkflowInstances(
074                            long companyId, String workflowDefinitionName,
075                            Integer workflowDefinitionVersion, Boolean completed, int start,
076                            int end, OrderByComparator orderByComparator)
077                    throws WorkflowException;
078    
079            public WorkflowInstance signalWorkflowInstance(
080                            long companyId, long userId, long workflowInstanceId,
081                            String transitionName, Map<String, Serializable> workflowContext)
082                    throws WorkflowException;
083    
084            public WorkflowInstance startWorkflowInstance(
085                            long companyId, long groupId, long userId,
086                            String workflowDefinitionName, Integer workflowDefinitionVersion,
087                            String transitionName, Map<String, Serializable> workflowContext)
088                    throws WorkflowException;
089    
090            public WorkflowInstance updateWorkflowContext(
091                            long companyId, long workflowInstanceId,
092                            Map<String, Serializable> workflowContext)
093                    throws WorkflowException;
094    
095    }