Search in sources :

Example 1 with ModelResponse

use of org.activiti.rest.service.api.repository.ModelResponse in project Activiti by Activiti.

the class RestResponseFactory method createModelResponse.

public ModelResponse createModelResponse(Model model, RestUrlBuilder urlBuilder) {
    ModelResponse response = new ModelResponse();
    response.setCategory(model.getCategory());
    response.setCreateTime(model.getCreateTime());
    response.setId(model.getId());
    response.setKey(model.getKey());
    response.setLastUpdateTime(model.getLastUpdateTime());
    response.setMetaInfo(model.getMetaInfo());
    response.setName(model.getName());
    response.setDeploymentId(model.getDeploymentId());
    response.setVersion(model.getVersion());
    response.setTenantId(model.getTenantId());
    response.setUrl(urlBuilder.buildUrl(RestUrls.URL_MODEL, model.getId()));
    if (model.getDeploymentId() != null) {
        response.setDeploymentUrl(urlBuilder.buildUrl(RestUrls.URL_DEPLOYMENT, model.getDeploymentId()));
    }
    if (model.hasEditorSource()) {
        response.setSourceUrl(urlBuilder.buildUrl(RestUrls.URL_MODEL_SOURCE, model.getId()));
    }
    if (model.hasEditorSourceExtra()) {
        response.setSourceExtraUrl(urlBuilder.buildUrl(RestUrls.URL_MODEL_SOURCE_EXTRA, model.getId()));
    }
    return response;
}
Also used : ModelResponse(org.activiti.rest.service.api.repository.ModelResponse)

Example 2 with ModelResponse

use of org.activiti.rest.service.api.repository.ModelResponse in project Activiti by Activiti.

the class RestResponseFactory method createModelResponseList.

public List<ModelResponse> createModelResponseList(List<Model> models) {
    RestUrlBuilder urlBuilder = createUrlBuilder();
    List<ModelResponse> responseList = new ArrayList<ModelResponse>();
    for (Model instance : models) {
        responseList.add(createModelResponse(instance, urlBuilder));
    }
    return responseList;
}
Also used : ModelResponse(org.activiti.rest.service.api.repository.ModelResponse) ArrayList(java.util.ArrayList) Model(org.activiti.engine.repository.Model)

Aggregations

ModelResponse (org.activiti.rest.service.api.repository.ModelResponse)2 ArrayList (java.util.ArrayList)1 Model (org.activiti.engine.repository.Model)1