1 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 ; 19 import java.sql.SQLException ; 20 import java.util.Collection ; 21 import java.util.Date ; 22 import java.util.List ; 23 import java.util.Map ; 24 25 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 getAllDefinitions() { 42 return executionService.getAllDefinitions(); 43 } 44 45 public List getAllDefinitions(Assembler assembler) { 46 return executionService.getAllDefinitions(assembler); 47 } 48 49 public Collection getTaskList(String targetActorId, Assembler assembler) { 50 return executionService.getTaskList(targetActorId, assembler); 51 } 52 53 public Token getToken(Long tokenId, Assembler assembler) { 54 return executionService.getToken(tokenId, assembler); 55 } 56 57 public ProcessInstance getProcessInstance(Long processInstanceId, Assembler assembler) { 58 return executionService.getProcessInstance(processInstanceId, assembler); 59 } 60 61 public Map getVariables(Long tokenId) { 62 return executionService.getVariables(tokenId); 63 } 64 65 public Definition getDefinition(Long definitionId, Assembler assembler) { 66 return executionService.getDefinition(definitionId, assembler); 67 } 68 69 public Definition getLatestDefinition(String name) { 70 return executionService.getLatestDefinition(name); 71 } 72 73 public Collection getLatestDefinitions() { 74 return executionService.getLatestDefinitions(); 75 } 76 77 public byte[] getFile(Long processDefinitionId, String fileName) { 78 return executionService.getFile(processDefinitionId, fileName); 79 } 80 81 public InvocationLog startProcessInstance(String actorId, Long definitionId) 82 throws ExecutionException { 83 return executionService.startProcessInstance(actorId, definitionId); 84 } 85 86 public InvocationLog startProcessInstance(String actorId, Long definitionId, Map variables) 87 throws ExecutionException { 88 return executionService.startProcessInstance(actorId, definitionId, variables); 89 } 90 91 public InvocationLog startProcessInstance(String actorId, Long definitionId, 92 Map variables, String transitionName) 93 throws ExecutionException { 94 return executionService.startProcessInstance(actorId, definitionId, variables, transitionName); 95 } 96 97 public InvocationLog setVariables(String actorId, Long tokenId, Map variables) 98 throws ExecutionException { 99 return executionService.setVariables(actorId, tokenId, variables); 100 } 101 102 public InvocationLog endOfState(String actorId, Long tokenId) 103 throws ExecutionException { 104 return executionService.endOfState(actorId, tokenId); 105 } 106 107 public InvocationLog endOfState(String actorId, Long tokenId, Map variables) 108 throws ExecutionException { 109 return executionService.endOfState(actorId, tokenId, variables); 110 } 111 112 public InvocationLog endOfState(String actorId, Long tokenId, 113 Map variables, String transitionName) 114 throws ExecutionException { 115 return executionService.endOfState(actorId, tokenId, variables, transitionName); 116 } 117 118 public InvocationLog cancelProcessInstance(String actorId, Long processInstanceId) 119 throws ExecutionException { 120 return executionService.cancelProcessInstance(actorId, processInstanceId); 121 } 122 123 public InvocationLog cancelToken(String actorId, Long flowId) 124 throws ExecutionException { 125 return executionService.cancelToken(actorId, flowId); 126 } 127 128 public InvocationLog undo(String actorId, Long processInstanceId, Date date) 129 throws ExecutionException { 130 return executionService.undo(actorId, processInstanceId, date); 131 } 132 } 133 | Popular Tags |