1
22
23 package com.liferay.portlet.workflow.service.impl;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portlet.workflow.jbi.WorkflowXMLUtil;
28 import com.liferay.portlet.workflow.model.WorkflowInstance;
29 import com.liferay.portlet.workflow.service.base.WorkflowInstanceServiceBaseImpl;
30
31 import java.rmi.RemoteException;
32
33 import java.text.ParseException;
34
35 import org.dom4j.DocumentException;
36
37
43 public class WorkflowInstanceServiceImpl
44 extends WorkflowInstanceServiceBaseImpl {
45
46 public WorkflowInstance addInstance(long definitionId)
47 throws PortalException, SystemException {
48
49 try {
50 String xml = workflowComponentService.startWorkflow(
51 definitionId);
52
53 return WorkflowXMLUtil.parseInstance(xml);
54 }
55 catch (DocumentException de) {
56 throw new SystemException(de);
57 }
58 catch (RemoteException re) {
59 throw new SystemException(re);
60 }
61 catch (ParseException pe) {
62 throw new SystemException(pe);
63 }
64 }
65
66 public void signalInstance(long instanceId)
67 throws PortalException, SystemException {
68
69 try {
70 workflowComponentService.signalInstance(instanceId);
71 }
72 catch (RemoteException re) {
73 throw new SystemException(re);
74 }
75 }
76
77 public void signalToken(long instanceId, long tokenId)
78 throws PortalException, SystemException {
79
80 try {
81 workflowComponentService.signalToken(instanceId, tokenId);
82 }
83 catch (RemoteException re) {
84 throw new SystemException(re);
85 }
86 }
87
88 }