/** * Look up an already-running process instance. * * @return the ProcessInstance */ public Object lookupProcess(Object processId) throws Exception { return processEngine.getExecutionService().findProcessInstanceById((String) processId); }
/** * Delete a process instance. */ @Override public void abortProcess(Object processInstanceId) throws Exception { processEngine.getExecutionService().endProcessInstance((String) processInstanceId, Execution.STATE_ENDED); }
/** * Delete a process instance. */ public void abortProcess(Object processInstanceId) throws Exception { processEngine.getExecutionService().endProcessInstance((String) processInstanceId, Execution.STATE_ENDED); }
/** * Look up an already-running process instance. * * @return the ProcessInstance */ @Override public Object lookupProcess(Object processId) throws Exception { return processEngine.getExecutionService().findProcessInstanceById((String) processId); }
/** * Start a new process. * * @return the newly-created ProcessInstance */ public Object startProcess(Object processDefinitionKey, Object signalName, Map variables) throws Exception { ProcessInstance processInstance = processEngine.getExecutionService().startProcessInstanceByKey((String) processDefinitionKey, (Map) variables); if (processInstance == null) { throw new IllegalArgumentException("No process definition found for process " + processDefinitionKey); } return processInstance; }
/** * Start a new process. * * @return the newly-created ProcessInstance */ @Override public Object startProcess(Object processDefinitionKey, Object signalName, Map variables) throws Exception { ProcessInstance processInstance = processEngine.getExecutionService().startProcessInstanceByKey((String) processDefinitionKey, variables); if (processInstance == null) { throw new IllegalArgumentException("No process definition found for process " + processDefinitionKey); } return processInstance; }
public Map<String, Object> getInstanceData(String instanceId) { Map<String, Object> data = new HashMap<String, Object>(); ExecutionService execService = this.processEngine.getExecutionService(); Set<String> keys = execService.getVariableNames(instanceId); data = execService.getVariables(instanceId, keys); return data; }
public void deleteInstance(String instanceId) { ExecutionService execService = this.processEngine.getExecutionService(); Execution exec = execService.findExecutionById(instanceId); if (null == exec) throw new IllegalArgumentException("No such execution with id " + instanceId); execService.deleteProcessInstance(instanceId); }
public ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars) { ExecutionService execService = this.processEngine.getExecutionService(); Execution exec = execService.startProcessInstanceById(definitionId, processVars); return ModelAdaptor.adoptExecution(exec); }
public ProcessInstanceRef newInstance(String definitionId) { ExecutionService execService = this.processEngine.getExecutionService(); Execution exec = execService.startProcessInstanceById(definitionId); return ModelAdaptor.adoptExecution(exec); }
public void signalExecution(String executionId, String signal) { ExecutionService execService = this.processEngine.getExecutionService(); if (null == signal) execService.signalExecutionById(executionId); else execService.signalExecutionById(executionId, signal); }
public void endInstance(String instanceId, ProcessInstanceRef.RESULT result) { ExecutionService execService = this.processEngine.getExecutionService(); Execution exec = execService.findExecutionById(instanceId); if (null == exec) throw new IllegalArgumentException("No such execution with id " + instanceId); ProcessInstanceRef.RESULT actualResult = result != null ? result : ProcessInstanceRef.RESULT.COMPLETED; execService.endProcessInstance(instanceId, actualResult.toString()); }
protected void initializeProcessEngine() { processEngine = ProcessEngineUtil.retrieveProcessEngine(); if (processEngine == null) { throw new RuntimeException("Process engine not initialized!"); } executionService = processEngine.getExecutionService(); taskService = processEngine.getTaskService(); historyService = processEngine.getHistoryService(); repositoryService = processEngine.getRepositoryService(); }
public ProcessInstanceRef getProcessInstance(String instanceId) { ExecutionService execService = this.processEngine.getExecutionService(); ProcessInstance processInstance = execService.createProcessInstanceQuery() .processInstanceId(instanceId) .uniqueResult(); return ModelAdaptor.adoptExecution(processInstance); }
Execution execution = processEngine.getExecutionService().findExecutionById((String) executionId); if (execution == null) processEngine.getExecutionService().setVariables((String) executionId, variables); ProcessInstance process = processEngine.getExecutionService().findProcessInstanceById(processId); if (process == null)
Execution execution = processEngine.getExecutionService().findExecutionById((String) executionId); if (execution == null) processEngine.getExecutionService().setVariables((String) executionId, variables); ProcessInstance process = processEngine.getExecutionService().findProcessInstanceById(processId); if (process == null)
public List<ProcessInstanceRef> getProcessInstances(String procDefId) { ExecutionService execService = this.processEngine.getExecutionService(); List<ProcessInstance> processInstances = execService.createProcessInstanceQuery() .processDefinitionId(procDefId) .list(); // must fetch process definition first to be able to get information about activities RepositoryService repositoryService = this.processEngine.getRepositoryService(); ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId).uniqueResult(); List<ProcessInstanceRef> results = adoptProcessInstances(processInstances, processDefinition); return results; }
public List<ActiveNodeInfo> getActiveNodeInfo(String processInstanceId) { List<ActiveNodeInfo> results = new ArrayList<ActiveNodeInfo>(); ProcessInstance pi = processEngine.getExecutionService().findProcessInstanceById(processInstanceId); Set<String> currentActivities = pi.findActiveActivityNames(); RepositoryService repoService = this.processEngine.getRepositoryService(); for (String activityName : currentActivities) { ActivityCoordinates coords = repoService.getActivityCoordinates(pi.getProcessDefinitionId(), activityName); results.add(new ActiveNodeInfo(coords.getWidth(), coords.getHeight(), new DiagramNodeInfo(activityName, coords.getX(), coords.getY(), coords.getWidth(), coords.getHeight()))); } return results; }
public DataHandler provideForm(FormAuthorityRef ref) { TaskService taskService = processEngine.getTaskService(); ExecutionService executionService = processEngine.getExecutionService(); RepositoryService repoService = processEngine.getRepositoryService(); ExecutionService execService = processEngine.getExecutionService(); Set<String> varNames = execService.getVariableNames(procInstId);
private InputStream loadCSS(String executionId) { RepositoryService repoService = processEngine.getRepositoryService(); ExecutionService execService = processEngine.getExecutionService(); Execution execution = execService.findExecutionById(executionId); if (execution != null) { ProcessDefinition definition = repoService.createProcessDefinitionQuery() .processDefinitionId(execution.getProcessDefinitionId()).uniqueResult(); InputStream in = repoService.getResourceAsStream(definition.getDeploymentId(), PROCESSFORMS_CSS); return in; } return null; } }