@Override public String getTenantId() { return activiti5ProcessInstance.getTenantId(); }
public ProcessInstanceResponse createProcessInstanceResponse(ProcessInstance processInstance, RestUrlBuilder urlBuilder) { ProcessInstanceResponse result = new ProcessInstanceResponse(); result.setActivityId(processInstance.getActivityId()); result.setBusinessKey(processInstance.getBusinessKey()); result.setId(processInstance.getId()); result.setName(processInstance.getName()); result.setProcessDefinitionId(processInstance.getProcessDefinitionId()); result.setProcessDefinitionUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_DEFINITION, processInstance.getProcessDefinitionId())); result.setProcessDefinitionKey(processInstance.getProcessDefinitionKey()); result.setEnded(processInstance.isEnded()); result.setSuspended(processInstance.isSuspended()); result.setUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_INSTANCE, processInstance.getId())); result.setTenantId(processInstance.getTenantId()); // Added by Ryan Johnston if (processInstance.isEnded()) { // Process complete. Note the same in the result. result.setCompleted(true); } else { // Process not complete. Note the same in the result. result.setCompleted(false); } // End Added by Ryan Johnston if (processInstance.getProcessVariables() != null) { Map<String, Object> variableMap = processInstance.getProcessVariables(); for (String name : variableMap.keySet()) { result.addVariable(createRestVariable(name, variableMap.get(name), RestVariableScope.LOCAL, processInstance.getId(), VARIABLE_PROCESS, false, urlBuilder)); } } return result; }
result.setSuspended(processInstance.isSuspended()); result.setUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_INSTANCE, processInstance.getId())); result.setTenantId(processInstance.getTenantId());