Search in sources :

Example 6 with ProcessDefinitionQuery

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

the class ProcessDefinitionQueryTest method testQueryByVersion.

public void testQueryByVersion() {
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionVersion(2);
    verifyQueryResults(query, 1);
    query = repositoryService.createProcessDefinitionQuery().processDefinitionVersion(1);
    verifyQueryResults(query, 2);
}
Also used : ProcessDefinitionQuery(org.activiti.engine.repository.ProcessDefinitionQuery)

Example 7 with ProcessDefinitionQuery

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

the class ProcessDefinitionQueryTest method testQueryByLatest.

public void testQueryByLatest() {
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().latestVersion();
    verifyQueryResults(query, 2);
    query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("one").latestVersion();
    verifyQueryResults(query, 1);
    query = repositoryService.createProcessDefinitionQuery().processDefinitionKey("two").latestVersion();
    verifyQueryResults(query, 1);
}
Also used : ProcessDefinitionQuery(org.activiti.engine.repository.ProcessDefinitionQuery)

Example 8 with ProcessDefinitionQuery

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

the class ProcessDefinitionQueryTest method testQueryByDeploymentId.

public void testQueryByDeploymentId() {
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentOneId);
    verifyQueryResults(query, 2);
}
Also used : ProcessDefinitionQuery(org.activiti.engine.repository.ProcessDefinitionQuery)

Example 9 with ProcessDefinitionQuery

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

the class ProcessDefinitionQueryTest method testQueryByInvalidKeyLike.

public void testQueryByInvalidKeyLike() {
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionKeyLike("%invalid%");
    verifyQueryResults(query, 0);
    try {
        repositoryService.createProcessDefinitionQuery().processDefinitionKeyLike(null);
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) ProcessDefinitionQuery(org.activiti.engine.repository.ProcessDefinitionQuery)

Example 10 with ProcessDefinitionQuery

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

the class ProcessDefinitionQueryTest method testQueryByInvalidVersion.

public void testQueryByInvalidVersion() {
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery().processDefinitionVersion(3);
    verifyQueryResults(query, 0);
    try {
        repositoryService.createProcessDefinitionQuery().processDefinitionVersion(-1).list();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
    try {
        repositoryService.createProcessDefinitionQuery().processDefinitionVersion(null).list();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) ProcessDefinitionQuery(org.activiti.engine.repository.ProcessDefinitionQuery)

Aggregations

ProcessDefinitionQuery (org.activiti.engine.repository.ProcessDefinitionQuery)29 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)7 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)5 SysBpmnResourceVO (com.netsteadfast.greenstep.vo.SysBpmnResourceVO)1 ArrayList (java.util.ArrayList)1 RepositoryService (org.activiti.engine.RepositoryService)1 ProcessDefinitionImpl (org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl)1 DeploymentQuery (org.activiti.engine.repository.DeploymentQuery)1 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)1 Task (org.activiti.engine.task.Task)1 Test (org.junit.Test)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1