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  @MessagingProxy(mode = ProxyMode.SYNC)
27  /**
28   * <a href="WorkflowInstanceManager.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Micha Kiener
31   * @author Shuyang Zhou
32   * @author Brian Wing Shun Chan
33   */
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> context)
61          throws WorkflowException;
62  
63      public WorkflowInstance startWorkflowInstance(
64              long companyId, long userId, String workflowDefinitionName,
65              Integer workflowDefinitionVersion, String transitionName,
66              Map<String, Serializable> context)
67          throws WorkflowException;
68  
69      public WorkflowInstance updateContext(
70              long companyId, long workflowInstanceId,
71              Map<String, Serializable> context)
72          throws WorkflowException;
73  
74  }