Search in sources :

Example 1 with TestIdentifyProviderCDI

use of org.jbpm.services.cdi.test.TestIdentifyProviderCDI in project jbpm by kiegroup.

the class HumanResourcesHiringTest method simpleExecutionTest.

@Test
public void simpleExecutionTest() {
    assertNotNull(managerFactory);
    String id = "custom-manager";
    AbstractAuditLogger auditLogger = AuditLoggerFactory.newJPAInstance();
    ServicesAwareAuditEventBuilder auditEventBuilder = new ServicesAwareAuditEventBuilder();
    auditEventBuilder.setIdentityProvider(new TestIdentifyProviderCDI());
    auditEventBuilder.setDeploymentUnitId(id);
    auditLogger.setBuilder(auditEventBuilder);
    RuntimeEnvironmentBuilder builder = RuntimeEnvironmentBuilder.Factory.get().newDefaultBuilder().entityManagerFactory(emf).registerableItemsFactory(InjectableRegisterableItemsFactory.getFactory(beanManager, auditLogger));
    builder.addAsset(ResourceFactory.newClassPathResource("repo/processes/hr/hiring.bpmn2"), ResourceType.BPMN2);
    RuntimeManager manager = managerFactory.newSingletonRuntimeManager(builder.get(), id);
    testHiringProcess(manager, EmptyContext.get());
    manager.close();
}
Also used : RuntimeManager(org.kie.api.runtime.manager.RuntimeManager) TestIdentifyProviderCDI(org.jbpm.services.cdi.test.TestIdentifyProviderCDI) AbstractAuditLogger(org.jbpm.process.audit.AbstractAuditLogger) ServicesAwareAuditEventBuilder(org.jbpm.kie.services.impl.audit.ServicesAwareAuditEventBuilder) RuntimeEnvironmentBuilder(org.kie.api.runtime.manager.RuntimeEnvironmentBuilder) AbstractKieServicesBaseTest(org.jbpm.kie.test.util.AbstractKieServicesBaseTest) Test(org.junit.Test)

Aggregations

ServicesAwareAuditEventBuilder (org.jbpm.kie.services.impl.audit.ServicesAwareAuditEventBuilder)1 AbstractKieServicesBaseTest (org.jbpm.kie.test.util.AbstractKieServicesBaseTest)1 AbstractAuditLogger (org.jbpm.process.audit.AbstractAuditLogger)1 TestIdentifyProviderCDI (org.jbpm.services.cdi.test.TestIdentifyProviderCDI)1 Test (org.junit.Test)1 RuntimeEnvironmentBuilder (org.kie.api.runtime.manager.RuntimeEnvironmentBuilder)1 RuntimeManager (org.kie.api.runtime.manager.RuntimeManager)1