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;
}
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;
}
Aggregations