private InputStream loadCSS(String deploymentId) { RepositoryService repoService = processEngine.getRepositoryService(); InputStream in = repoService.getResourceAsStream( deploymentId, PROCESSFORMS_CSS ); return in; } }
@Override public void setMessageService(MessageService msgService) { MuleMessageService serviceProxy = processEngine.get(MuleMessageService.class); serviceProxy.setMessageService(msgService); }
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(); }
/** * Delete a process instance. */ public void abortProcess(Object processInstanceId) throws Exception { processEngine.getExecutionService().endProcessInstance((String) processInstanceId, Execution.STATE_ENDED); }
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 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);
task.setCreateDate(jbpmTask.getCreateTime()); ExecutionService executionService = ProcessEngineUtil.retrieveProcessEngine().getExecutionService(); TaskService taskService = ProcessEngineUtil.retrieveProcessEngine().getTaskService(); List<Participation> participations = taskService.getTaskParticipations(jbpmTask.getId()); for (Participation participation : participations) {
private boolean taskHasForm(String id) { boolean result = false; TaskService taskService = processEngine.getTaskService(); Task task = taskService.getTask(id); result = (task.getFormResourceName() != null); return result; }
public void dispose() { if (!containerManaged && processEngine != null) { processEngine.close(); processEngine = null; } }
private List<HistoryActivityInstanceRef> getProcessInstanceHistory(String processInstanceId) { org.jbpm.api.HistoryService historyService = this.processEngine.getHistoryService(); List<HistoryActivityInstance> his = historyService.createHistoryActivityInstanceQuery().processInstanceId(processInstanceId).list(); List<HistoryActivityInstanceRef> results = new ArrayList<HistoryActivityInstanceRef>(); for (HistoryActivityInstance t0 : his) { results.add(ModelAdaptor.adoptHistoryActivity(t0)); } return results; }
/** * Look up an already-running process instance. * * @return the ProcessInstance */ @Override public Object lookupProcess(Object processId) throws Exception { return processEngine.getExecutionService().findProcessInstanceById((String) processId); }
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; } }
public void completeTask(Task task, String outcome, Map variables) { processEngine.getTaskService().completeTask(task.getId(), outcome, variables); }
@Override public void dispose() { if (!containerManaged && processEngine != null) { processEngine.close(); processEngine = null; } }
private List<HistoryProcessInstanceRef> getFinishedProcessInstances(String definitionId) { org.jbpm.api.HistoryService historyService = this.processEngine.getHistoryService(); List<HistoryProcessInstanceRef> results = new ArrayList<HistoryProcessInstanceRef>(); List<HistoryProcessInstance> his = historyService.createHistoryProcessInstanceQuery().processDefinitionId(definitionId).list(); for (HistoryProcessInstance t0 : his) { // all only finished elements if (t0.getEndTime() != null) { results.add(ModelAdaptor.adoptHistoryProcessInstance(t0)); } } return results; }
public void deleteDeployment(String id) { RepositoryService repositoryService = this.processEngine.getRepositoryService(); repositoryService.deleteDeploymentCascade(id); }
/** * Look up an already-running process instance. * * @return the ProcessInstance */ 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; }
public void setMessageService(MessageService msgService) { MuleMessageService serviceProxy = processEngine.get(MuleMessageService.class); serviceProxy.setMessageService(msgService); }
public void completeTask(Task task, String outcome, Map variables) { processEngine.getTaskService().completeTask(task.getId(), outcome, variables); }