use of org.activiti.engine.ProcessEngineInfo in project Activiti by Activiti.
the class ProcessEngineResource method getEngineInfo.
@RequestMapping(value = "/management/engine", method = RequestMethod.GET, produces = "application/json")
public ProcessEngineInfoResponse getEngineInfo() {
ProcessEngineInfoResponse response = new ProcessEngineInfoResponse();
try {
ProcessEngineInfo engineInfo = ProcessEngines.getProcessEngineInfo(engine.getName());
if (engineInfo != null) {
response.setName(engineInfo.getName());
response.setResourceUrl(engineInfo.getResourceUrl());
response.setException(engineInfo.getException());
} else {
// Revert to using process-engine directly
response.setName(engine.getName());
}
} catch (Exception e) {
throw new ActivitiException("Error retrieving process info", e);
}
response.setVersion(ProcessEngine.VERSION);
return response;
}
use of org.activiti.engine.ProcessEngineInfo in project Activiti by Activiti.
the class ProcessEnginesTest method testProcessEngineInfo.
public void testProcessEngineInfo() {
List<ProcessEngineInfo> processEngineInfos = ProcessEngines.getProcessEngineInfos();
assertEquals(1, processEngineInfos.size());
ProcessEngineInfo processEngineInfo = processEngineInfos.get(0);
assertNull(processEngineInfo.getException());
assertNotNull(processEngineInfo.getName());
assertNotNull(processEngineInfo.getResourceUrl());
ProcessEngine processEngine = ProcessEngines.getProcessEngine(ProcessEngines.NAME_DEFAULT);
assertNotNull(processEngine);
}
Aggregations