001    /**
002     * Copyright (c) 2000-2010 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.InputStream;
022    
023    import java.util.List;
024    
025    /**
026     * @author Micha Kiener
027     * @author Shuyang Zhou
028     * @author Brian Wing Shun Chan
029     * @author Marcellus Tavares
030     */
031    @MessagingProxy(mode = ProxyMode.SYNC)
032    public interface WorkflowDefinitionManager {
033    
034            public WorkflowDefinition deployWorkflowDefinition(
035                            long companyId, long userId, String title, InputStream inputStream)
036                    throws WorkflowException;
037    
038            public int getActiveWorkflowDefinitionCount(long companyId)
039                    throws WorkflowException;
040    
041            public int getActiveWorkflowDefinitionCount(long companyId, String name)
042                    throws WorkflowException;
043    
044            public List<WorkflowDefinition> getActiveWorkflowDefinitions(
045                            long companyId, int start, int end,
046                            OrderByComparator orderByComparator)
047                    throws WorkflowException;
048    
049            public List<WorkflowDefinition> getActiveWorkflowDefinitions(
050                            long companyId, String name, int start, int end,
051                            OrderByComparator orderByComparator)
052                    throws WorkflowException;
053    
054            public WorkflowDefinition getWorkflowDefinition(
055                            long companyId, String name, int version)
056                    throws WorkflowException;
057    
058            public int getWorkflowDefinitionCount(long companyId)
059                    throws WorkflowException;
060    
061            public int getWorkflowDefinitionCount(long companyId, String name)
062                    throws WorkflowException;
063    
064            public List<WorkflowDefinition> getWorkflowDefinitions(
065                            long companyId, int start, int end,
066                            OrderByComparator orderByComparator)
067                    throws WorkflowException;
068    
069            public List<WorkflowDefinition> getWorkflowDefinitions(
070                            long companyId, String name, int start, int end,
071                            OrderByComparator orderByComparator)
072                    throws WorkflowException;
073    
074            public void undeployWorkflowDefinition(
075                            long companyId, long userId, String name, int version)
076                    throws WorkflowException;
077    
078            public WorkflowDefinition updateActive(
079                            long companyId, long userId, String name, int version,
080                            boolean active)
081                    throws WorkflowException;
082    
083            public WorkflowDefinition updateTitle(
084                            long companyId, long userId, String name, int version, String title)
085                    throws WorkflowException;
086    
087    }