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.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    }