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.Serializable;
22  
23  import java.util.List;
24  import java.util.Map;
25  
26  /**
27   * <a href="WorkflowInstanceManager.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Micha Kiener
30   * @author Shuyang Zhou
31   * @author Brian Wing Shun Chan
32   */
33  @MessagingProxy(mode = ProxyMode.SYNC)
34  public interface WorkflowInstanceManager {
35  
36      public void deleteWorkflowInstance(long companyId, long workflowInstanceId)
37          throws WorkflowException;
38  
39      public List<String> getNextTransitionNames(
40              long companyId, long userId, long workflowInstanceId)
41          throws WorkflowException;
42  
43      public WorkflowInstance getWorkflowInstance(
44              long companyId, long workflowInstanceId)
45          throws WorkflowException;
46  
47      public int getWorkflowInstanceCount(
48              long companyId, String workflowDefinitionName,
49              Integer workflowDefinitionVersion, Boolean completed)
50          throws WorkflowException;
51  
52      public List<WorkflowInstance> getWorkflowInstances(
53              long companyId, String workflowDefinitionName,
54              Integer workflowDefinitionVersion, Boolean completed, int start,
55              int end, OrderByComparator orderByComparator)
56          throws WorkflowException;
57  
58      public WorkflowInstance signalWorkflowInstance(
59              long companyId, long userId, long workflowInstanceId,
60              String transitionName, Map<String, Serializable> workflowContext)
61          throws WorkflowException;
62  
63      public WorkflowInstance startWorkflowInstance(
64              long companyId, long groupId, long userId,
65              String workflowDefinitionName, Integer workflowDefinitionVersion,
66              String transitionName, Map<String, Serializable> workflowContext)
67          throws WorkflowException;
68  
69      public WorkflowInstance updateWorkflowContext(
70              long companyId, long workflowInstanceId,
71              Map<String, Serializable> workflowContext)
72          throws WorkflowException;
73  
74  }