Search in sources :

Example 1 with ActivityInstanceDto

use of org.camunda.bpm.engine.rest.dto.runtime.ActivityInstanceDto in project camunda-bpm-platform by camunda.

the class ProcessInstanceResourceImpl method getActivityInstanceTree.

@Override
public ActivityInstanceDto getActivityInstanceTree() {
    RuntimeService runtimeService = engine.getRuntimeService();
    ActivityInstance activityInstance = null;
    try {
        activityInstance = runtimeService.getActivityInstance(processInstanceId);
    } catch (AuthorizationException e) {
        throw e;
    } catch (ProcessEngineException e) {
        throw new InvalidRequestException(Status.INTERNAL_SERVER_ERROR, e, e.getMessage());
    }
    if (activityInstance == null) {
        throw new InvalidRequestException(Status.NOT_FOUND, "Process instance with id " + processInstanceId + " does not exist");
    }
    ActivityInstanceDto result = ActivityInstanceDto.fromActivityInstance(activityInstance);
    return result;
}
Also used : ActivityInstanceDto(org.camunda.bpm.engine.rest.dto.runtime.ActivityInstanceDto) ActivityInstance(org.camunda.bpm.engine.runtime.ActivityInstance) RuntimeService(org.camunda.bpm.engine.RuntimeService) AuthorizationException(org.camunda.bpm.engine.AuthorizationException) InvalidRequestException(org.camunda.bpm.engine.rest.exception.InvalidRequestException) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Aggregations

AuthorizationException (org.camunda.bpm.engine.AuthorizationException)1 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 RuntimeService (org.camunda.bpm.engine.RuntimeService)1 ActivityInstanceDto (org.camunda.bpm.engine.rest.dto.runtime.ActivityInstanceDto)1 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)1 ActivityInstance (org.camunda.bpm.engine.runtime.ActivityInstance)1