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