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.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     * @author Eduardo Lundgren
031     */
032    @MessagingProxy(mode = ProxyMode.SYNC)
033    public interface WorkflowDefinitionManager {
034    
035            public WorkflowDefinition deployWorkflowDefinition(
036                            long companyId, long userId, String title, InputStream inputStream)
037                    throws WorkflowException;
038    
039            public int getActiveWorkflowDefinitionCount(long companyId)
040                    throws WorkflowException;
041    
042            public int getActiveWorkflowDefinitionCount(long companyId, String name)
043                    throws WorkflowException;
044    
045            public List<WorkflowDefinition> getActiveWorkflowDefinitions(
046                            long companyId, int start, int end,
047                            OrderByComparator orderByComparator)
048                    throws WorkflowException;
049    
050            public List<WorkflowDefinition> getActiveWorkflowDefinitions(
051                            long companyId, String name, int start, int end,
052                            OrderByComparator orderByComparator)
053                    throws WorkflowException;
054    
055            public WorkflowDefinition getLatestKaleoDefinition(
056                            long companyId, String name)
057                    throws WorkflowException;
058    
059            public WorkflowDefinition getWorkflowDefinition(
060                            long companyId, String name, int version)
061                    throws WorkflowException;
062    
063            public int getWorkflowDefinitionCount(long companyId)
064                    throws WorkflowException;
065    
066            public int getWorkflowDefinitionCount(long companyId, String name)
067                    throws WorkflowException;
068    
069            public List<WorkflowDefinition> getWorkflowDefinitions(
070                            long companyId, int start, int end,
071                            OrderByComparator orderByComparator)
072                    throws WorkflowException;
073    
074            public List<WorkflowDefinition> getWorkflowDefinitions(
075                            long companyId, String name, int start, int end,
076                            OrderByComparator orderByComparator)
077                    throws WorkflowException;
078    
079            public void undeployWorkflowDefinition(
080                            long companyId, long userId, String name, int version)
081                    throws WorkflowException;
082    
083            public WorkflowDefinition updateActive(
084                            long companyId, long userId, String name, int version,
085                            boolean active)
086                    throws WorkflowException;
087    
088            public WorkflowDefinition updateTitle(
089                            long companyId, long userId, String name, int version, String title)
090                    throws WorkflowException;
091    
092            public void validateWorkflowDefinition(InputStream inputStream)
093                    throws WorkflowException;
094    
095    }