Search in sources :

Example 11 with ModelQuery

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

the class ModelQueryTest method testQueryByVersion.

public void testQueryByVersion() {
    ModelQuery query = repositoryService.createModelQuery().modelVersion(1);
    assertThat(query.list()).hasSize(1);
    assertThat(query.count()).isEqualTo(1);
}
Also used : ModelQuery(org.activiti.engine.repository.ModelQuery)

Example 12 with ModelQuery

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

the class ModelQueryTest method testQueryByInvalidCategory.

public void testQueryByInvalidCategory() {
    ModelQuery query = repositoryService.createModelQuery().modelCategory("invalid");
    assertThat(query.singleResult()).isNull();
    assertThat(query.list()).hasSize(0);
    assertThat(query.count()).isEqualTo(0);
}
Also used : ModelQuery(org.activiti.engine.repository.ModelQuery)

Example 13 with ModelQuery

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

the class ModelQueryTest method testQueryNoCriteria.

public void testQueryNoCriteria() {
    ModelQuery query = repositoryService.createModelQuery();
    assertThat(query.list()).hasSize(1);
    assertThat(query.count()).isEqualTo(1);
}
Also used : ModelQuery(org.activiti.engine.repository.ModelQuery)

Example 14 with ModelQuery

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

the class ModelQueryTest method testQueryByInvalidCategoryLike.

public void testQueryByInvalidCategoryLike() {
    ModelQuery query = repositoryService.createModelQuery().modelCategoryLike("%invalid%");
    assertThat(query.singleResult()).isNull();
    assertThat(query.list()).hasSize(0);
    assertThat(query.count()).isEqualTo(0);
}
Also used : ModelQuery(org.activiti.engine.repository.ModelQuery)

Example 15 with ModelQuery

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

the class ModelQueryTest method testNotDeployed.

public void testNotDeployed() {
    ModelQuery query = repositoryService.createModelQuery().notDeployed();
    assertThat(query.count()).isEqualTo(1);
    assertThat(query.list()).hasSize(1);
}
Also used : 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