Search in sources :

Example 1 with ProcessEngineInfo

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;
}
Also used : ProcessEngineInfo(org.activiti.engine.ProcessEngineInfo) ActivitiException(org.activiti.engine.ActivitiException) ActivitiException(org.activiti.engine.ActivitiException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with ProcessEngineInfo

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);
}
Also used : ProcessEngineInfo(org.activiti.engine.ProcessEngineInfo) ProcessEngine(org.activiti.engine.ProcessEngine)

Aggregations

ProcessEngineInfo (org.activiti.engine.ProcessEngineInfo)2 ActivitiException (org.activiti.engine.ActivitiException)1 ProcessEngine (org.activiti.engine.ProcessEngine)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1