1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.workflow;
16  
17  import com.liferay.portal.kernel.messaging.proxy.MessagingProxy;
18  import com.liferay.portal.kernel.messaging.proxy.ProxyMode;
19  import com.liferay.portal.kernel.util.OrderByComparator;
20  
21  import java.io.InputStream;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="WorkflowDefinitionManager.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Micha Kiener
29   * @author Shuyang Zhou
30   * @author Brian Wing Shun Chan
31   * @author Marcellus Tavares
32   */
33  @MessagingProxy(mode = ProxyMode.SYNC)
34  public interface WorkflowDefinitionManager {
35  
36      public WorkflowDefinition deployWorkflowDefinition(
37              long companyId, long userId, String title, InputStream inputStream)
38          throws WorkflowException;
39  
40      public int getActiveWorkflowDefinitionCount(long companyId)
41          throws WorkflowException;
42  
43      public int getActiveWorkflowDefinitionCount(long companyId, String name)
44          throws WorkflowException;
45  
46      public List<WorkflowDefinition> getActiveWorkflowDefinitions(
47              long companyId, int start, int end,
48              OrderByComparator orderByComparator)
49          throws WorkflowException;
50  
51      public List<WorkflowDefinition> getActiveWorkflowDefinitions(
52              long companyId, String name, int start, int end,
53              OrderByComparator orderByComparator)
54          throws WorkflowException;
55  
56      public WorkflowDefinition getWorkflowDefinition(
57              long companyId, String name, int version)
58          throws WorkflowException;
59  
60      public int getWorkflowDefinitionCount(long companyId)
61          throws WorkflowException;
62  
63      public int getWorkflowDefinitionCount(long companyId, String name)
64          throws WorkflowException;
65  
66      public List<WorkflowDefinition> getWorkflowDefinitions(
67              long companyId, int start, int end,
68              OrderByComparator orderByComparator)
69          throws WorkflowException;
70  
71      public List<WorkflowDefinition> getWorkflowDefinitions(
72              long companyId, String name, int start, int end,
73              OrderByComparator orderByComparator)
74          throws WorkflowException;
75  
76      public void undeployWorkflowDefinition(
77              long companyId, long userId, String name, int version)
78          throws WorkflowException;
79  
80      public WorkflowDefinition updateActive(
81              long companyId, long userId, String name, int version,
82              boolean active)
83          throws WorkflowException;
84  
85      public WorkflowDefinition updateTitle(
86              long companyId, long userId, String name, int version, String title)
87          throws WorkflowException;
88  
89  }