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