Search in sources :

Example 1 with TestIdentityProvider

use of org.jbpm.kie.services.test.TestIdentityProvider 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

FormManagerServiceImpl (org.jbpm.kie.services.impl.FormManagerServiceImpl)1 KModuleDeploymentService (org.jbpm.kie.services.impl.KModuleDeploymentService)1 ProcessServiceImpl (org.jbpm.kie.services.impl.ProcessServiceImpl)1 RuntimeDataServiceImpl (org.jbpm.kie.services.impl.RuntimeDataServiceImpl)1 UserTaskServiceImpl (org.jbpm.kie.services.impl.UserTaskServiceImpl)1 BPMN2DataServiceImpl (org.jbpm.kie.services.impl.bpmn2.BPMN2DataServiceImpl)1 QueryServiceImpl (org.jbpm.kie.services.impl.query.QueryServiceImpl)1 TestIdentityProvider (org.jbpm.kie.services.test.TestIdentityProvider)1 RuntimeManagerFactoryImpl (org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl)1 UserTaskService (org.jbpm.services.api.UserTaskService)1 TransactionalCommandService (org.jbpm.shared.services.impl.TransactionalCommandService)1 TaskService (org.kie.api.task.TaskService)1