1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.workflow.service;
24  
25  
26  /**
27   * <a href="WorkflowComponentServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portlet.workflow.service.WorkflowComponentService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * <p>
43   * <code>com.liferay.portlet.workflow.service.WorkflowComponentServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portlet.workflow.service.WorkflowComponentService
50   * @see com.liferay.portlet.workflow.service.WorkflowComponentServiceFactory
51   *
52   */
53  public class WorkflowComponentServiceUtil {
54      public static java.util.List getCurrentTasks(long instanceId, long tokenId)
55          throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
56              java.rmi.RemoteException {
57          WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
58  
59          return workflowComponentService.getCurrentTasks(instanceId, tokenId);
60      }
61  
62      public static java.lang.String getCurrentTasksXml(long instanceId,
63          long tokenId)
64          throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
65              java.rmi.RemoteException {
66          WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
67  
68          return workflowComponentService.getCurrentTasksXml(instanceId, tokenId);
69      }
70  
71      public static java.lang.String deploy(java.lang.String xml)
72          throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
73              java.rmi.RemoteException {
74          WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
75  
76          return workflowComponentService.deploy(xml);
77      }
78  
79      public static java.lang.Object getDefinition(long definitionId)
80          throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
81              java.rmi.RemoteException {
82          WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
83  
84          return workflowComponentService.getDefinition(definitionId);
85      }
86  
87      public static java.util.List getDefinitions(long definitionId,
88          java.lang.String name, int begin, int end)
89          throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
90              java.rmi.RemoteException {
91          WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
92  
93          return workflowComponentService.getDefinitions(definitionId, name,
94              begin, end);
95      }
96  
97      public static java.lang.String getDefinitionsXml(long definitionId,
98          java.lang.String name, int begin, int end)
99          throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
100             java.rmi.RemoteException {
101         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
102 
103         return workflowComponentService.getDefinitionsXml(definitionId, name,
104             begin, end);
105     }
106 
107     public static int getDefinitionsCount(long definitionId,
108         java.lang.String name)
109         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
110             java.rmi.RemoteException {
111         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
112 
113         return workflowComponentService.getDefinitionsCount(definitionId, name);
114     }
115 
116     public static java.lang.String getDefinitionsCountXml(long definitionId,
117         java.lang.String name)
118         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
119             java.rmi.RemoteException {
120         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
121 
122         return workflowComponentService.getDefinitionsCountXml(definitionId,
123             name);
124     }
125 
126     public static java.lang.String getDefinitionXml(long definitionId)
127         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
128             java.rmi.RemoteException {
129         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
130 
131         return workflowComponentService.getDefinitionXml(definitionId);
132     }
133 
134     public static java.util.List getInstances(long definitionId,
135         long instanceId, java.lang.String definitionName,
136         java.lang.String definitionVersion, java.lang.String startDateGT,
137         java.lang.String startDateLT, java.lang.String endDateGT,
138         java.lang.String endDateLT, boolean hideEndedTasks,
139         boolean retrieveUserInstances, boolean andOperator, int begin, int end)
140         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
141             java.rmi.RemoteException {
142         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
143 
144         return workflowComponentService.getInstances(definitionId, instanceId,
145             definitionName, definitionVersion, startDateGT, startDateLT,
146             endDateGT, endDateLT, hideEndedTasks, retrieveUserInstances,
147             andOperator, begin, end);
148     }
149 
150     public static int getInstancesCount(long definitionId, long instanceId,
151         java.lang.String definitionName, java.lang.String definitionVersion,
152         java.lang.String startDateGT, java.lang.String startDateLT,
153         java.lang.String endDateGT, java.lang.String endDateLT,
154         boolean hideEndedTasks, boolean retrieveUserInstances,
155         boolean andOperator)
156         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
157             java.rmi.RemoteException {
158         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
159 
160         return workflowComponentService.getInstancesCount(definitionId,
161             instanceId, definitionName, definitionVersion, startDateGT,
162             startDateLT, endDateGT, endDateLT, hideEndedTasks,
163             retrieveUserInstances, andOperator);
164     }
165 
166     public static java.lang.String getInstancesCountXml(long definitionId,
167         long instanceId, java.lang.String definitionName,
168         java.lang.String definitionVersion, java.lang.String startDateGT,
169         java.lang.String startDateLT, java.lang.String endDateGT,
170         java.lang.String endDateLT, boolean hideEndedTasks,
171         boolean retrieveUserInstances, boolean andOperator)
172         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
173             java.rmi.RemoteException {
174         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
175 
176         return workflowComponentService.getInstancesCountXml(definitionId,
177             instanceId, definitionName, definitionVersion, startDateGT,
178             startDateLT, endDateGT, endDateLT, hideEndedTasks,
179             retrieveUserInstances, andOperator);
180     }
181 
182     public static java.lang.String getInstancesXml(long definitionId,
183         long instanceId, java.lang.String definitionName,
184         java.lang.String definitionVersion, java.lang.String startDateGT,
185         java.lang.String startDateLT, java.lang.String endDateGT,
186         java.lang.String endDateLT, boolean hideEndedTasks,
187         boolean retrieveUserInstances, boolean andOperator, int begin, int end)
188         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
189             java.rmi.RemoteException {
190         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
191 
192         return workflowComponentService.getInstancesXml(definitionId,
193             instanceId, definitionName, definitionVersion, startDateGT,
194             startDateLT, endDateGT, endDateLT, hideEndedTasks,
195             retrieveUserInstances, andOperator, begin, end);
196     }
197 
198     public static com.liferay.portlet.workflow.model.WorkflowTask getTask(
199         long taskId)
200         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
201             java.rmi.RemoteException {
202         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
203 
204         return workflowComponentService.getTask(taskId);
205     }
206 
207     public static java.lang.String getTaskXml(long taskId)
208         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
209             java.rmi.RemoteException {
210         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
211 
212         return workflowComponentService.getTaskXml(taskId);
213     }
214 
215     public static java.util.List getTaskFormElements(long taskId)
216         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
217             java.rmi.RemoteException {
218         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
219 
220         return workflowComponentService.getTaskFormElements(taskId);
221     }
222 
223     public static java.lang.String getTaskFormElementsXml(long taskId)
224         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
225             java.rmi.RemoteException {
226         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
227 
228         return workflowComponentService.getTaskFormElementsXml(taskId);
229     }
230 
231     public static java.util.List getTaskTransitions(long taskId)
232         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
233             java.rmi.RemoteException {
234         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
235 
236         return workflowComponentService.getTaskTransitions(taskId);
237     }
238 
239     public static java.lang.String getTaskTransitionsXml(long taskId)
240         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
241             java.rmi.RemoteException {
242         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
243 
244         return workflowComponentService.getTaskTransitionsXml(taskId);
245     }
246 
247     public static java.util.List getUserTasks(long instanceId,
248         java.lang.String taskName, java.lang.String definitionName,
249         java.lang.String assignedTo, java.lang.String createDateGT,
250         java.lang.String createDateLT, java.lang.String startDateGT,
251         java.lang.String startDateLT, java.lang.String endDateGT,
252         java.lang.String endDateLT, boolean hideEndedTasks,
253         boolean andOperator, int begin, int end)
254         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
255             java.rmi.RemoteException {
256         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
257 
258         return workflowComponentService.getUserTasks(instanceId, taskName,
259             definitionName, assignedTo, createDateGT, createDateLT,
260             startDateGT, startDateLT, endDateGT, endDateLT, hideEndedTasks,
261             andOperator, begin, end);
262     }
263 
264     public static int getUserTasksCount(long instanceId,
265         java.lang.String taskName, java.lang.String definitionName,
266         java.lang.String assignedTo, java.lang.String createDateGT,
267         java.lang.String createDateLT, java.lang.String startDateGT,
268         java.lang.String startDateLT, java.lang.String endDateGT,
269         java.lang.String endDateLT, boolean hideEndedTasks, boolean andOperator)
270         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
271             java.rmi.RemoteException {
272         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
273 
274         return workflowComponentService.getUserTasksCount(instanceId, taskName,
275             definitionName, assignedTo, createDateGT, createDateLT,
276             startDateGT, startDateLT, endDateGT, endDateLT, hideEndedTasks,
277             andOperator);
278     }
279 
280     public static java.lang.String getUserTasksCountXml(long instanceId,
281         java.lang.String taskName, java.lang.String definitionName,
282         java.lang.String assignedTo, java.lang.String createDateGT,
283         java.lang.String createDateLT, java.lang.String startDateGT,
284         java.lang.String startDateLT, java.lang.String endDateGT,
285         java.lang.String endDateLT, boolean hideEndedTasks, boolean andOperator)
286         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
287             java.rmi.RemoteException {
288         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
289 
290         return workflowComponentService.getUserTasksCountXml(instanceId,
291             taskName, definitionName, assignedTo, createDateGT, createDateLT,
292             startDateGT, startDateLT, endDateGT, endDateLT, hideEndedTasks,
293             andOperator);
294     }
295 
296     public static java.lang.String getUserTasksXml(long instanceId,
297         java.lang.String taskName, java.lang.String definitionName,
298         java.lang.String assignedTo, java.lang.String createDateGT,
299         java.lang.String createDateLT, java.lang.String startDateGT,
300         java.lang.String startDateLT, java.lang.String endDateGT,
301         java.lang.String endDateLT, boolean hideEndedTasks,
302         boolean andOperator, int begin, int end)
303         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
304             java.rmi.RemoteException {
305         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
306 
307         return workflowComponentService.getUserTasksXml(instanceId, taskName,
308             definitionName, assignedTo, createDateGT, createDateLT,
309             startDateGT, startDateLT, endDateGT, endDateLT, hideEndedTasks,
310             andOperator, begin, end);
311     }
312 
313     public static void signalInstance(long instanceId)
314         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
315             java.rmi.RemoteException {
316         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
317 
318         workflowComponentService.signalInstance(instanceId);
319     }
320 
321     public static void signalToken(long instanceId, long tokenId)
322         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
323             java.rmi.RemoteException {
324         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
325 
326         workflowComponentService.signalToken(instanceId, tokenId);
327     }
328 
329     public static java.lang.String startWorkflow(long definitionId)
330         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
331             java.rmi.RemoteException {
332         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
333 
334         return workflowComponentService.startWorkflow(definitionId);
335     }
336 
337     public static java.util.Map updateTask(long taskId,
338         java.lang.String transition, java.util.Map parameterMap)
339         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
340             java.rmi.RemoteException {
341         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
342 
343         return workflowComponentService.updateTask(taskId, transition,
344             parameterMap);
345     }
346 
347     public static java.lang.String updateTaskXml(long taskId,
348         java.lang.String transition, java.util.Map parameterMap)
349         throws com.liferay.portal.kernel.jbi.WorkflowComponentException,
350             java.rmi.RemoteException {
351         WorkflowComponentService workflowComponentService = WorkflowComponentServiceFactory.getService();
352 
353         return workflowComponentService.updateTaskXml(taskId, transition,
354             parameterMap);
355     }
356 }