Search in sources :

Example 1 with RuntimeDataServiceImpl

use of org.jbpm.kie.services.impl.RuntimeDataServiceImpl in project jbpm by kiegroup.

the class AbstractCaseServicesBaseTest method configureServices.

protected void configureServices() {
    buildDatasource();
    emf = EntityManagerFactoryManager.get().getOrCreate("org.jbpm.domain");
    identityProvider = new TestIdentityProvider();
    authorizationManager = new AuthorizationManagerImpl(identityProvider, new TransactionalCommandService(emf));
    // build definition service
    bpmn2Service = new BPMN2DataServiceImpl();
    DeploymentRolesManager deploymentRolesManager = new DeploymentRolesManager();
    queryService = new QueryServiceImpl();
    ((QueryServiceImpl) queryService).setIdentityProvider(identityProvider);
    ((QueryServiceImpl) queryService).setCommandService(new TransactionalCommandService(emf));
    ((QueryServiceImpl) queryService).init();
    // build deployment service
    deploymentService = new KModuleDeploymentService();
    ((KModuleDeploymentService) deploymentService).setBpmn2Service(bpmn2Service);
    ((KModuleDeploymentService) deploymentService).setEmf(emf);
    ((KModuleDeploymentService) deploymentService).setIdentityProvider(identityProvider);
    ((KModuleDeploymentService) deploymentService).setManagerFactory(new RuntimeManagerFactoryImpl());
    ((KModuleDeploymentService) deploymentService).setFormManagerService(new FormManagerServiceImpl());
    TaskService taskService = HumanTaskServiceFactory.newTaskServiceConfigurator().entityManagerFactory(emf).getTaskService();
    // build runtime data service
    runtimeDataService = new RuntimeDataServiceImpl();
    ((RuntimeDataServiceImpl) runtimeDataService).setCommandService(new TransactionalCommandService(emf));
    ((RuntimeDataServiceImpl) runtimeDataService).setIdentityProvider(identityProvider);
    ((RuntimeDataServiceImpl) runtimeDataService).setTaskService(taskService);
    ((RuntimeDataServiceImpl) runtimeDataService).setDeploymentRolesManager(deploymentRolesManager);
    ((RuntimeDataServiceImpl) runtimeDataService).setTaskAuditService(TaskAuditServiceFactory.newTaskAuditServiceConfigurator().setTaskService(taskService).getTaskAuditService());
    ((KModuleDeploymentService) deploymentService).setRuntimeDataService(runtimeDataService);
    // build process service
    processService = new ProcessServiceImpl();
    ((ProcessServiceImpl) processService).setDataService(runtimeDataService);
    ((ProcessServiceImpl) processService).setDeploymentService(deploymentService);
    // build user task service
    userTaskService = new UserTaskServiceImpl();
    ((UserTaskServiceImpl) userTaskService).setDataService(runtimeDataService);
    ((UserTaskServiceImpl) userTaskService).setDeploymentService(deploymentService);
    // build case id generator
    caseIdGenerator = new TableCaseIdGenerator(new TransactionalCommandService(emf));
    // build case runtime data service
    caseRuntimeDataService = new CaseRuntimeDataServiceImpl();
    ((CaseRuntimeDataServiceImpl) caseRuntimeDataService).setCaseIdGenerator(caseIdGenerator);
    ((CaseRuntimeDataServiceImpl) caseRuntimeDataService).setRuntimeDataService(runtimeDataService);
    ((CaseRuntimeDataServiceImpl) caseRuntimeDataService).setCommandService(new TransactionalCommandService(emf));
    ((CaseRuntimeDataServiceImpl) caseRuntimeDataService).setIdentityProvider(identityProvider);
    ((CaseRuntimeDataServiceImpl) caseRuntimeDataService).setDeploymentRolesManager(deploymentRolesManager);
    // build case service
    caseService = new CaseServiceImpl();
    ((CaseServiceImpl) caseService).setCaseIdGenerator(caseIdGenerator);
    ((CaseServiceImpl) caseService).setCaseRuntimeDataService(caseRuntimeDataService);
    ((CaseServiceImpl) caseService).setProcessService(processService);
    ((CaseServiceImpl) caseService).setDeploymentService(deploymentService);
    ((CaseServiceImpl) caseService).setRuntimeDataService(runtimeDataService);
    ((CaseServiceImpl) caseService).setCommandService(new TransactionalCommandService(emf));
    ((CaseServiceImpl) caseService).setAuthorizationManager(authorizationManager);
    ((CaseServiceImpl) caseService).setIdentityProvider(identityProvider);
    CaseConfigurationDeploymentListener configurationListener = new CaseConfigurationDeploymentListener(identityProvider);
    // set runtime data service as listener on deployment service
    ((KModuleDeploymentService) deploymentService).addListener((RuntimeDataServiceImpl) runtimeDataService);
    ((KModuleDeploymentService) deploymentService).addListener((BPMN2DataServiceImpl) bpmn2Service);
    ((KModuleDeploymentService) deploymentService).addListener((QueryServiceImpl) queryService);
    ((KModuleDeploymentService) deploymentService).addListener((CaseRuntimeDataServiceImpl) caseRuntimeDataService);
    ((KModuleDeploymentService) deploymentService).addListener(configurationListener);
}
Also used : FormManagerServiceImpl(org.jbpm.kie.services.impl.FormManagerServiceImpl) BPMN2DataServiceImpl(org.jbpm.kie.services.impl.bpmn2.BPMN2DataServiceImpl) RuntimeManagerFactoryImpl(org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl) CaseConfigurationDeploymentListener(org.jbpm.casemgmt.impl.event.CaseConfigurationDeploymentListener) UserTaskService(org.jbpm.services.api.UserTaskService) TaskService(org.kie.api.task.TaskService) UserTaskServiceImpl(org.jbpm.kie.services.impl.UserTaskServiceImpl) TableCaseIdGenerator(org.jbpm.casemgmt.impl.generator.TableCaseIdGenerator) DeploymentRolesManager(org.jbpm.kie.services.impl.security.DeploymentRolesManager) KModuleDeploymentService(org.jbpm.kie.services.impl.KModuleDeploymentService) ProcessServiceImpl(org.jbpm.kie.services.impl.ProcessServiceImpl) RuntimeDataServiceImpl(org.jbpm.kie.services.impl.RuntimeDataServiceImpl) CaseRuntimeDataServiceImpl(org.jbpm.casemgmt.impl.CaseRuntimeDataServiceImpl) TransactionalCommandService(org.jbpm.shared.services.impl.TransactionalCommandService) CaseServiceImpl(org.jbpm.casemgmt.impl.CaseServiceImpl) CaseRuntimeDataServiceImpl(org.jbpm.casemgmt.impl.CaseRuntimeDataServiceImpl) QueryServiceImpl(org.jbpm.kie.services.impl.query.QueryServiceImpl) AuthorizationManagerImpl(org.jbpm.casemgmt.impl.AuthorizationManagerImpl)

Example 2 with RuntimeDataServiceImpl

use of org.jbpm.kie.services.impl.RuntimeDataServiceImpl 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)

Example 3 with RuntimeDataServiceImpl

use of org.jbpm.kie.services.impl.RuntimeDataServiceImpl in project jbpm by kiegroup.

the class AbstractKieServicesBaseTest method configureServices.

protected void configureServices() {
    buildDatasource();
    emf = EntityManagerFactoryManager.get().getOrCreate("org.jbpm.domain");
    identityProvider = new TestIdentityProvider();
    formManagerService = new FormManagerServiceImpl();
    // build definition service
    bpmn2Service = new BPMN2DataServiceImpl();
    queryService = new QueryServiceImpl();
    ((QueryServiceImpl) queryService).setIdentityProvider(identityProvider);
    ((QueryServiceImpl) queryService).setCommandService(new TransactionalCommandService(emf));
    ((QueryServiceImpl) queryService).init();
    // build deployment service
    deploymentService = new KModuleDeploymentService();
    ((KModuleDeploymentService) deploymentService).setBpmn2Service(bpmn2Service);
    ((KModuleDeploymentService) deploymentService).setEmf(emf);
    ((KModuleDeploymentService) deploymentService).setIdentityProvider(identityProvider);
    ((KModuleDeploymentService) deploymentService).setManagerFactory(new RuntimeManagerFactoryImpl());
    ((KModuleDeploymentService) deploymentService).setFormManagerService(formManagerService);
    TaskService taskService = HumanTaskServiceFactory.newTaskServiceConfigurator().entityManagerFactory(emf).getTaskService();
    // build runtime data service
    runtimeDataService = new RuntimeDataServiceImpl();
    ((RuntimeDataServiceImpl) runtimeDataService).setCommandService(new TransactionalCommandService(emf));
    ((RuntimeDataServiceImpl) runtimeDataService).setIdentityProvider(identityProvider);
    ((RuntimeDataServiceImpl) runtimeDataService).setTaskService(taskService);
    ((RuntimeDataServiceImpl) runtimeDataService).setTaskAuditService(TaskAuditServiceFactory.newTaskAuditServiceConfigurator().setTaskService(taskService).getTaskAuditService());
    ((KModuleDeploymentService) deploymentService).setRuntimeDataService(runtimeDataService);
    // set runtime data service as listener on deployment service
    ((KModuleDeploymentService) deploymentService).addListener(((RuntimeDataServiceImpl) runtimeDataService));
    ((KModuleDeploymentService) deploymentService).addListener(((BPMN2DataServiceImpl) bpmn2Service));
    ((KModuleDeploymentService) deploymentService).addListener(((QueryServiceImpl) queryService));
    // build process service
    processService = new ProcessServiceImpl();
    ((ProcessServiceImpl) processService).setDataService(runtimeDataService);
    ((ProcessServiceImpl) processService).setDeploymentService(deploymentService);
    // build user task service
    userTaskService = new UserTaskServiceImpl();
    ((UserTaskServiceImpl) userTaskService).setDataService(runtimeDataService);
    ((UserTaskServiceImpl) userTaskService).setDeploymentService(deploymentService);
}
Also used : FormManagerServiceImpl(org.jbpm.kie.services.impl.FormManagerServiceImpl) BPMN2DataServiceImpl(org.jbpm.kie.services.impl.bpmn2.BPMN2DataServiceImpl) KModuleDeploymentService(org.jbpm.kie.services.impl.KModuleDeploymentService) RuntimeManagerFactoryImpl(org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl) ProcessServiceImpl(org.jbpm.kie.services.impl.ProcessServiceImpl) RuntimeDataServiceImpl(org.jbpm.kie.services.impl.RuntimeDataServiceImpl) UserTaskService(org.jbpm.services.api.UserTaskService) TaskService(org.kie.api.task.TaskService) TestIdentityProvider(org.jbpm.kie.services.test.TestIdentityProvider) TransactionalCommandService(org.jbpm.shared.services.impl.TransactionalCommandService) UserTaskServiceImpl(org.jbpm.kie.services.impl.UserTaskServiceImpl) QueryServiceImpl(org.jbpm.kie.services.impl.query.QueryServiceImpl)

Aggregations

RuntimeDataServiceImpl (org.jbpm.kie.services.impl.RuntimeDataServiceImpl)3 FormManagerServiceImpl (org.jbpm.kie.services.impl.FormManagerServiceImpl)2 KModuleDeploymentService (org.jbpm.kie.services.impl.KModuleDeploymentService)2 ProcessServiceImpl (org.jbpm.kie.services.impl.ProcessServiceImpl)2 UserTaskServiceImpl (org.jbpm.kie.services.impl.UserTaskServiceImpl)2 BPMN2DataServiceImpl (org.jbpm.kie.services.impl.bpmn2.BPMN2DataServiceImpl)2 QueryServiceImpl (org.jbpm.kie.services.impl.query.QueryServiceImpl)2 RuntimeManagerFactoryImpl (org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl)2 UserTaskService (org.jbpm.services.api.UserTaskService)2 TransactionalCommandService (org.jbpm.shared.services.impl.TransactionalCommandService)2 TaskService (org.kie.api.task.TaskService)2 AuthorizationManagerImpl (org.jbpm.casemgmt.impl.AuthorizationManagerImpl)1 CaseRuntimeDataServiceImpl (org.jbpm.casemgmt.impl.CaseRuntimeDataServiceImpl)1 CaseServiceImpl (org.jbpm.casemgmt.impl.CaseServiceImpl)1 CaseConfigurationDeploymentListener (org.jbpm.casemgmt.impl.event.CaseConfigurationDeploymentListener)1 TableCaseIdGenerator (org.jbpm.casemgmt.impl.generator.TableCaseIdGenerator)1 DeploymentRolesManager (org.jbpm.kie.services.impl.security.DeploymentRolesManager)1 TestIdentityProvider (org.jbpm.kie.services.test.TestIdentityProvider)1 TestUserGroupCallbackImpl (org.jbpm.kie.services.test.objects.TestUserGroupCallbackImpl)1 ProcessInstanceDesc (org.jbpm.services.api.model.ProcessInstanceDesc)1