Search in sources :

Example 1 with TestUserGroupCallbackImpl

use of org.jbpm.kie.services.test.objects.TestUserGroupCallbackImpl in project jbpm by kiegroup.

the class RuntimeDataServiceImplTaskLookupTest method asssertProcessInstance.

private void asssertProcessInstance() {
    assertTrue(((RuntimeDataServiceImpl) runtimeDataService).getUserGroupCallback() instanceof TestUserGroupCallbackImpl);
    Collection<ProcessInstanceDesc> instances = runtimeDataService.getProcessInstances(new QueryContext());
    assertNotNull(instances);
    assertEquals(0, instances.size());
    processInstanceId = processService.startProcess(deploymentUnit.getIdentifier(), "UserTask");
    assertNotNull(processInstanceId);
    instances = runtimeDataService.getProcessInstancesByProcessDefinition("UserTask", new QueryContext());
    assertNotNull(instances);
    assertEquals(1, instances.size());
    ProcessInstanceDesc instance = instances.iterator().next();
    assertEquals(1, (int) instance.getState());
    assertEquals("UserTask", instance.getProcessId());
}
Also used : RuntimeDataServiceImpl(org.jbpm.kie.services.impl.RuntimeDataServiceImpl) TestUserGroupCallbackImpl(org.jbpm.kie.services.test.objects.TestUserGroupCallbackImpl) ProcessInstanceDesc(org.jbpm.services.api.model.ProcessInstanceDesc) QueryContext(org.kie.api.runtime.query.QueryContext)

Aggregations

RuntimeDataServiceImpl (org.jbpm.kie.services.impl.RuntimeDataServiceImpl)1 TestUserGroupCallbackImpl (org.jbpm.kie.services.test.objects.TestUserGroupCallbackImpl)1 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)1 QueryContext (org.kie.api.runtime.query.QueryContext)1