Search in sources :

Example 1 with ExecutionResponse

use of org.activiti.rest.service.api.runtime.process.ExecutionResponse in project Activiti by Activiti.

the class RestResponseFactory method createExecutionResponseList.

public List<ExecutionResponse> createExecutionResponseList(List<Execution> executions) {
    RestUrlBuilder urlBuilder = createUrlBuilder();
    List<ExecutionResponse> responseList = new ArrayList<ExecutionResponse>();
    for (Execution instance : executions) {
        responseList.add(createExecutionResponse(instance, urlBuilder));
    }
    return responseList;
}
Also used : Execution(org.activiti.engine.runtime.Execution) ExecutionResponse(org.activiti.rest.service.api.runtime.process.ExecutionResponse) ArrayList(java.util.ArrayList)

Example 2 with ExecutionResponse

use of org.activiti.rest.service.api.runtime.process.ExecutionResponse in project Activiti by Activiti.

the class RestResponseFactory method createExecutionResponse.

public ExecutionResponse createExecutionResponse(Execution execution, RestUrlBuilder urlBuilder) {
    ExecutionResponse result = new ExecutionResponse();
    result.setActivityId(execution.getActivityId());
    result.setId(execution.getId());
    result.setUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION, execution.getId()));
    result.setSuspended(execution.isSuspended());
    result.setTenantId(execution.getTenantId());
    result.setParentId(execution.getParentId());
    if (execution.getParentId() != null) {
        result.setParentUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION, execution.getParentId()));
    }
    result.setSuperExecutionId(execution.getSuperExecutionId());
    if (execution.getSuperExecutionId() != null) {
        result.setSuperExecutionUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION, execution.getSuperExecutionId()));
    }
    result.setProcessInstanceId(execution.getProcessInstanceId());
    if (execution.getProcessInstanceId() != null) {
        result.setProcessInstanceUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_INSTANCE, execution.getProcessInstanceId()));
    }
    return result;
}
Also used : ExecutionResponse(org.activiti.rest.service.api.runtime.process.ExecutionResponse)

Aggregations

ExecutionResponse (org.activiti.rest.service.api.runtime.process.ExecutionResponse)2 ArrayList (java.util.ArrayList)1 Execution (org.activiti.engine.runtime.Execution)1