001
014
015 package com.liferay.portal.kernel.workflow;
016
017 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018 import com.liferay.portal.kernel.util.OrderByComparator;
019
020 import java.io.Serializable;
021
022 import java.util.List;
023 import java.util.Map;
024
025
032 public class WorkflowInstanceManagerUtil {
033
034 public static void deleteWorkflowInstance(
035 long companyId, long workflowInstanceId)
036 throws WorkflowException {
037
038 getWorkflowInstanceManager().deleteWorkflowInstance(
039 companyId, workflowInstanceId);
040 }
041
042 public static List<String> getNextTransitionNames(
043 long companyId, long userId, long workflowInstanceId)
044 throws WorkflowException {
045
046 return getWorkflowInstanceManager().getNextTransitionNames(
047 companyId, userId, workflowInstanceId);
048 }
049
050 public static WorkflowInstance getWorkflowInstance(
051 long companyId, long workflowInstanceId)
052 throws WorkflowException {
053
054 return getWorkflowInstanceManager().getWorkflowInstance(
055 companyId, workflowInstanceId);
056 }
057
058 public static int getWorkflowInstanceCount(
059 long companyId, Long userId, String assetClassName,
060 Long assetClassPK, Boolean completed)
061 throws WorkflowException {
062
063 return getWorkflowInstanceManager().getWorkflowInstanceCount(
064 companyId, userId, assetClassName, assetClassPK, completed);
065 }
066
067 public static int getWorkflowInstanceCount(
068 long companyId, Long userId, String[] assetClassNames,
069 Boolean completed)
070 throws WorkflowException {
071
072 return getWorkflowInstanceManager().getWorkflowInstanceCount(
073 companyId, userId, assetClassNames, completed);
074 }
075
076 public static int getWorkflowInstanceCount(
077 long companyId, String workflowDefinitionName,
078 Integer workflowDefinitionVersion, Boolean completed)
079 throws WorkflowException {
080
081 return getWorkflowInstanceManager().getWorkflowInstanceCount(
082 companyId, workflowDefinitionName, workflowDefinitionVersion,
083 completed);
084 }
085
086 public static WorkflowInstanceManager getWorkflowInstanceManager() {
087 PortalRuntimePermission.checkGetBeanProperty(
088 WorkflowInstanceManagerUtil.class);
089
090 return _workflowInstanceManager;
091 }
092
093 public static List<WorkflowInstance> getWorkflowInstances(
094 long companyId, Long userId, String assetClassName,
095 Long assetClassPK, Boolean completed, int start, int end,
096 OrderByComparator<WorkflowInstance> orderByComparator)
097 throws WorkflowException {
098
099 return getWorkflowInstanceManager().getWorkflowInstances(
100 companyId, userId, assetClassName, assetClassPK, completed, start,
101 end, orderByComparator);
102 }
103
104 public static List<WorkflowInstance> getWorkflowInstances(
105 long companyId, Long userId, String[] assetClassNames,
106 Boolean completed, int start, int end,
107 OrderByComparator<WorkflowInstance> orderByComparator)
108 throws WorkflowException {
109
110 return getWorkflowInstanceManager().getWorkflowInstances(
111 companyId, userId, assetClassNames, completed, start, end,
112 orderByComparator);
113 }
114
115 public static List<WorkflowInstance> getWorkflowInstances(
116 long companyId, String workflowDefinitionName,
117 Integer workflowDefinitionVersion, Boolean completed, int start,
118 int end, OrderByComparator<WorkflowInstance> orderByComparator)
119 throws WorkflowException {
120
121 return getWorkflowInstanceManager().getWorkflowInstances(
122 companyId, workflowDefinitionName, workflowDefinitionVersion,
123 completed, start, end, orderByComparator);
124 }
125
126 public static List<WorkflowInstance> search(
127 long companyId, Long userId, String assetType, String nodeName,
128 String kaleoDefinitionName, Boolean completed, int start, int end,
129 OrderByComparator<WorkflowInstance> orderByComparator)
130 throws WorkflowException {
131
132 return getWorkflowInstanceManager().search(
133 companyId, userId, assetType, nodeName, kaleoDefinitionName,
134 completed, start, end, orderByComparator);
135 }
136
137 public static int searchCount(
138 long companyId, Long userId, String assetType, String nodeName,
139 String kaleoDefinitionName, Boolean completed)
140 throws WorkflowException {
141
142 return getWorkflowInstanceManager().searchCount(
143 companyId, userId, assetType, nodeName, kaleoDefinitionName,
144 completed);
145 }
146
147 public static WorkflowInstance signalWorkflowInstance(
148 long companyId, long userId, long workflowInstanceId,
149 String transitionName, Map<String, Serializable> workflowContext)
150 throws WorkflowException {
151
152 return getWorkflowInstanceManager().signalWorkflowInstance(
153 companyId, userId, workflowInstanceId, transitionName,
154 workflowContext);
155 }
156
157 public static WorkflowInstance startWorkflowInstance(
158 long companyId, long groupId, long userId,
159 String workflowDefinitionName, Integer workflowDefinitionVersion,
160 String transitionName, Map<String, Serializable> workflowContext)
161 throws WorkflowException {
162
163 return getWorkflowInstanceManager().startWorkflowInstance(
164 companyId, groupId, userId, workflowDefinitionName,
165 workflowDefinitionVersion, transitionName, workflowContext);
166 }
167
168 public static WorkflowInstance updateWorkflowContext(
169 long companyId, long workflowInstanceId,
170 Map<String, Serializable> workflowContext)
171 throws WorkflowException {
172
173 return getWorkflowInstanceManager().updateWorkflowContext(
174 companyId, workflowInstanceId, workflowContext);
175 }
176
177 public void setWorkflowInstanceManager(
178 WorkflowInstanceManager workflowInstanceManager) {
179
180 PortalRuntimePermission.checkSetBeanProperty(getClass());
181
182 _workflowInstanceManager = workflowInstanceManager;
183 }
184
185 private static WorkflowInstanceManager _workflowInstanceManager;
186
187 }