KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > workflow > impl > WorkflowExecutionServiceImpl


1 /*
2  * Copyright 2001-2003 The eXo platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  */

5
6 package org.exoplatform.services.workflow.impl;
7
8 import org.exoplatform.services.workflow.WorkflowExecutionService;
9 import org.jbpm.Assembler;
10 import org.jbpm.ExecutionException;
11 import org.jbpm.ExecutionService;
12 import org.jbpm.JbpmServiceFactory;
13 import org.jbpm.model.definition.Definition;
14 import org.jbpm.model.execution.ProcessInstance;
15 import org.jbpm.model.execution.Token;
16 import org.jbpm.model.log.InvocationLog;
17
18 import javax.sql.DataSource JavaDoc;
19 import java.sql.SQLException JavaDoc;
20 import java.util.Collection JavaDoc;
21 import java.util.Date JavaDoc;
22 import java.util.List JavaDoc;
23 import java.util.Map JavaDoc;
24
25 /**
26  * Created y the eXo platform team
27  * User: Benjamin Mestrallet
28  * Date: 9 mai 2004
29  */

30 public class WorkflowExecutionServiceImpl implements WorkflowExecutionService{
31   private ExecutionService executionService;
32
33   public WorkflowExecutionServiceImpl(JbpmServiceFactory serviceLocator) {
34     executionService = serviceLocator.getExecutionService();
35   }
36
37   public void close() {
38     executionService.close();
39   }
40
41   public List JavaDoc getAllDefinitions() {
42     return executionService.getAllDefinitions();
43   }
44
45   public List JavaDoc getAllDefinitions(Assembler assembler) {
46     return executionService.getAllDefinitions(assembler);
47   }
48
49   public Collection JavaDoc getTaskList(String JavaDoc targetActorId, Assembler assembler) {
50     return executionService.getTaskList(targetActorId, assembler);
51   }
52
53   public Token getToken(Long JavaDoc tokenId, Assembler assembler) {
54     return executionService.getToken(tokenId, assembler);
55   }
56
57   public ProcessInstance getProcessInstance(Long JavaDoc processInstanceId, Assembler assembler) {
58     return executionService.getProcessInstance(processInstanceId, assembler);
59   }
60
61   public Map JavaDoc getVariables(Long JavaDoc tokenId) {
62     return executionService.getVariables(tokenId);
63   }
64
65   public Definition getDefinition(Long JavaDoc definitionId, Assembler assembler) {
66     return executionService.getDefinition(definitionId, assembler);
67   }
68
69   public Definition getLatestDefinition(String JavaDoc name) {
70     return executionService.getLatestDefinition(name);
71   }
72
73   public Collection JavaDoc getLatestDefinitions() {
74     return executionService.getLatestDefinitions();
75   }
76
77   public byte[] getFile(Long JavaDoc processDefinitionId, String JavaDoc fileName) {
78     return executionService.getFile(processDefinitionId, fileName);
79   }
80
81   public InvocationLog startProcessInstance(String JavaDoc actorId, Long JavaDoc definitionId)
82       throws ExecutionException {
83     return executionService.startProcessInstance(actorId, definitionId);
84   }
85
86   public InvocationLog startProcessInstance(String JavaDoc actorId, Long JavaDoc definitionId, Map JavaDoc variables)
87       throws ExecutionException {
88     return executionService.startProcessInstance(actorId, definitionId, variables);
89   }
90
91   public InvocationLog startProcessInstance(String JavaDoc actorId, Long JavaDoc definitionId,
92                                             Map JavaDoc variables, String JavaDoc transitionName)
93       throws ExecutionException {
94     return executionService.startProcessInstance(actorId, definitionId, variables, transitionName);
95   }
96
97   public InvocationLog setVariables(String JavaDoc actorId, Long JavaDoc tokenId, Map JavaDoc variables)
98       throws ExecutionException {
99     return executionService.setVariables(actorId, tokenId, variables);
100   }
101
102   public InvocationLog endOfState(String JavaDoc actorId, Long JavaDoc tokenId)
103       throws ExecutionException {
104     return executionService.endOfState(actorId, tokenId);
105   }
106
107   public InvocationLog endOfState(String JavaDoc actorId, Long JavaDoc tokenId, Map JavaDoc variables)
108       throws ExecutionException {
109     return executionService.endOfState(actorId, tokenId, variables);
110   }
111
112   public InvocationLog endOfState(String JavaDoc actorId, Long JavaDoc tokenId,
113                                   Map JavaDoc variables, String JavaDoc transitionName)
114       throws ExecutionException {
115     return executionService.endOfState(actorId, tokenId, variables, transitionName);
116   }
117
118   public InvocationLog cancelProcessInstance(String JavaDoc actorId, Long JavaDoc processInstanceId)
119       throws ExecutionException {
120     return executionService.cancelProcessInstance(actorId, processInstanceId);
121   }
122
123   public InvocationLog cancelToken(String JavaDoc actorId, Long JavaDoc flowId)
124       throws ExecutionException {
125     return executionService.cancelToken(actorId, flowId);
126   }
127
128   public InvocationLog undo(String JavaDoc actorId, Long JavaDoc processInstanceId, Date JavaDoc date)
129       throws ExecutionException {
130     return executionService.undo(actorId, processInstanceId, date);
131   }
132 }
133
Popular Tags