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()); }
/** * Look up an already-running process instance. * * @return the ProcessInstance */ public Object lookupProcess(Object processId) throws Exception { return processEngine.getExecutionService().findProcessInstanceById((String) processId); }
public void signalExecution(String executionId, String signal) { ExecutionService execService = this.processEngine.getExecutionService(); if (null == signal) execService.signalExecutionById(executionId); else execService.signalExecutionById(executionId, signal); }
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); }
Execution execution = processEngine.getExecutionService().findExecutionById((String) executionId); while (execution == null && waitTime < PROCESS_CREATION_WAIT) execution = processEngine.getExecutionService().findExecutionById((String) executionId); processEngine.getExecutionService().setVariables((String) executionId, variables); processEngine.getExecutionService().signalExecutionById((String) executionId, (String) signalName, 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)
Execution execution = executionService.findExecutionById(executionId); String procInstId = execution.getProcessInstance().getId(); ProcessDefinition procDef = repoService.createProcessDefinitionQuery() Set<String> varNames = execService.getVariableNames(procInstId); processContext = execService.getVariables(procInstId, varNames);
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; } }
/** * Delete a process instance. */ @Override public void abortProcess(Object processInstanceId) throws Exception { processEngine.getExecutionService().endProcessInstance((String) processInstanceId, Execution.STATE_ENDED); }
/** * 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; }
Execution execution = processEngine.getExecutionService().findExecutionById((String) executionId); while (execution == null && waitTime < PROCESS_CREATION_WAIT) execution = processEngine.getExecutionService().findExecutionById((String) executionId); processEngine.getExecutionService().setVariables((String) executionId, variables); processEngine.getExecutionService().signalExecutionById((String) executionId, (String) signalName, 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)
Execution execution = executionService.findExecutionById(executionId); if (execution != null) { Execution pi = execution.getProcessInstance();
/** * Delete a process instance. */ public void abortProcess(Object processInstanceId) throws Exception { processEngine.getExecutionService().endProcessInstance((String) processInstanceId, Execution.STATE_ENDED); }
/** * 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; }
/** * Look up an already-running process instance. * * @return the ProcessInstance */ @Override public Object lookupProcess(Object processId) throws Exception { return processEngine.getExecutionService().findProcessInstanceById((String) processId); }
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; }