Search in sources :

Example 21 with ModelQuery

use of org.activiti.engine.repository.ModelQuery in project Activiti by Activiti.

the class ModelQueryTest method testModelProperties.

public void testModelProperties() {
    ModelQuery query = repositoryService.createModelQuery();
    Model model = query.singleResult();
    assertThat(model.getId()).isNotNull();
    assertThat(model.getCategory()).isNotNull();
    assertThat(model.getKey()).isNotNull();
    assertThat(model.getName()).isNotNull();
    assertThat(model.getVersion()).isNotNull();
    assertThat(model.getCreateTime()).isNotNull();
    assertThat(model.getLastUpdateTime()).isNotNull();
}
Also used : Model(org.activiti.engine.repository.Model) ModelQuery(org.activiti.engine.repository.ModelQuery)

Example 22 with ModelQuery

use of org.activiti.engine.repository.ModelQuery in project Activiti by Activiti.

the class ModelQueryTest method testQueryByNameAndKey.

public void testQueryByNameAndKey() {
    ModelQuery query = repositoryService.createModelQuery().modelKey("someKey");
    Model model = query.singleResult();
    assertThat(model).isNotNull();
    assertThat(query.list()).hasSize(1);
    assertThat(query.count()).isEqualTo(1);
}
Also used : Model(org.activiti.engine.repository.Model) ModelQuery(org.activiti.engine.repository.ModelQuery)

Example 23 with ModelQuery

use of org.activiti.engine.repository.ModelQuery in project Activiti by Activiti.

the class ModelQueryTest method testQueryByNameLike.

public void testQueryByNameLike() throws Exception {
    ModelQuery query = repositoryService.createModelQuery().modelNameLike("%model%");
    Model model = query.singleResult();
    assertThat(model).isNotNull();
    assertThat(new String(repositoryService.getModelEditorSource(model.getId()), "utf-8")).isEqualTo("bytes");
    assertThat(query.list()).hasSize(1);
    assertThat(query.count()).isEqualTo(1);
}
Also used : Model(org.activiti.engine.repository.Model) ModelQuery(org.activiti.engine.repository.ModelQuery)

Aggregations

ModelQuery (org.activiti.engine.repository.ModelQuery)23 Model (org.activiti.engine.repository.Model)9 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 RepositoryService (org.activiti.engine.RepositoryService)1 RestResponseFactory (org.wso2.carbon.bpmn.rest.common.RestResponseFactory)1 DataResponse (org.wso2.carbon.bpmn.rest.model.common.DataResponse)1 ModelResponse (org.wso2.carbon.bpmn.rest.model.repository.ModelResponse)1 ModelsPaginateList (org.wso2.carbon.bpmn.rest.model.repository.ModelsPaginateList)1