Search in sources :

Example 1 with DeploymentStore

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

the class DeploymentServiceWithSyncTest method configureDeploymentSync.

protected void configureDeploymentSync() {
    assertNotNull(deploymentService);
    store = new DeploymentStore();
    if (commandService == null) {
        commandService = new TransactionalCommandService(emf);
    }
    store.setCommandService(commandService);
    DeploymentSynchronizer sync = new DeploymentSynchronizer();
    sync.setDeploymentService(deploymentService);
    sync.setDeploymentStore(store);
    invoker = new DeploymentSyncInvoker(sync, 1L, 1L, TimeUnit.SECONDS);
    invoker.start();
}
Also used : DeploymentStore(org.jbpm.kie.services.impl.store.DeploymentStore) DeploymentSyncInvoker(org.jbpm.kie.services.impl.store.DeploymentSyncInvoker) DeploymentSynchronizer(org.jbpm.kie.services.impl.store.DeploymentSynchronizer) TransactionalCommandService(org.jbpm.shared.services.impl.TransactionalCommandService)

Example 2 with DeploymentStore

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

the class DeploymentStoreTest method setup.

@Before
public void setup() {
    buildDatasource();
    emf = EntityManagerFactoryManager.get().getOrCreate("org.jbpm.domain");
    store = new DeploymentStore();
    store.setCommandService(new TransactionalCommandService(emf));
}
Also used : DeploymentStore(org.jbpm.kie.services.impl.store.DeploymentStore) TransactionalCommandService(org.jbpm.shared.services.impl.TransactionalCommandService) Before(org.junit.Before)

Example 3 with DeploymentStore

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

the class DeploymentSynchronizerCDIImpl method configure.

@PostConstruct
public void configure() {
    DeploymentStore store = new DeploymentStore();
    store.setCommandService(commandService);
    setDeploymentStore(store);
}
Also used : DeploymentStore(org.jbpm.kie.services.impl.store.DeploymentStore) PostConstruct(javax.annotation.PostConstruct)

Example 4 with DeploymentStore

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

the class DeactivateDeploymentServiceWithSyncTest method configureDeploymentSync.

protected void configureDeploymentSync() {
    assertNotNull(deploymentService);
    store = new DeploymentStore();
    if (commandService == null) {
        commandService = new TransactionalCommandService(emf);
    }
    store.setCommandService(commandService);
    sync = new DeploymentSynchronizer();
    sync.setDeploymentService(deploymentService);
    sync.setDeploymentStore(store);
    invoker = new DeploymentSyncInvoker(sync, 1L, 1L, TimeUnit.SECONDS);
}
Also used : DeploymentStore(org.jbpm.kie.services.impl.store.DeploymentStore) DeploymentSyncInvoker(org.jbpm.kie.services.impl.store.DeploymentSyncInvoker) DeploymentSynchronizer(org.jbpm.kie.services.impl.store.DeploymentSynchronizer) TransactionalCommandService(org.jbpm.shared.services.impl.TransactionalCommandService)

Example 5 with DeploymentStore

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

the class DeploymentServiceEJBIntegrationTest method testDeploymentOfProcessesVerifyTransientObjectOmitted.

@Test
public void testDeploymentOfProcessesVerifyTransientObjectOmitted() {
    assertNotNull(deploymentService);
    assertNotNull(commandService);
    DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION);
    deploymentService.deploy(deploymentUnit);
    units.add(deploymentUnit);
    DeployedUnit deployed = deploymentService.getDeployedUnit(deploymentUnit.getIdentifier());
    assertNotNull(deployed);
    assertNotNull(deployed.getDeploymentUnit());
    assertNotNull(deployed.getRuntimeManager());
    assertNotNull(runtimeDataService);
    Collection<ProcessDefinition> processes = runtimeDataService.getProcesses(new QueryContext());
    assertNotNull(processes);
    assertEquals(5, processes.size());
    DeploymentStore store = new DeploymentStore();
    store.setCommandService(commandService);
    Collection<DeploymentUnit> units = store.getEnabledDeploymentUnits();
    assertNotNull(units);
    assertEquals(1, units.size());
    DeploymentUnit enabled = units.iterator().next();
    assertNotNull(enabled);
    assertTrue(enabled instanceof KModuleDeploymentUnit);
    KModuleDeploymentUnit kmoduleEnabled = (KModuleDeploymentUnit) enabled;
    DeploymentDescriptor dd = kmoduleEnabled.getDeploymentDescriptor();
    assertNotNull(dd);
    // ejb deployment service add transitively Async WorkItem handler that should not be stored as part of deployment store
    assertEquals(0, dd.getWorkItemHandlers().size());
}
Also used : DeploymentStore(org.jbpm.kie.services.impl.store.DeploymentStore) DeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor) DeployedUnit(org.jbpm.services.api.model.DeployedUnit) ProcessDefinition(org.jbpm.services.api.model.ProcessDefinition) QueryContext(org.kie.api.runtime.query.QueryContext) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) DeploymentUnit(org.jbpm.services.api.model.DeploymentUnit) KModuleDeploymentUnit(org.jbpm.kie.services.impl.KModuleDeploymentUnit) Test(org.junit.Test)

Aggregations

DeploymentStore (org.jbpm.kie.services.impl.store.DeploymentStore)10 KModuleDeploymentUnit (org.jbpm.kie.services.impl.KModuleDeploymentUnit)4 DeployedUnit (org.jbpm.services.api.model.DeployedUnit)4 Test (org.junit.Test)4 CoundDownDeploymentListener (org.jbpm.kie.services.test.objects.CoundDownDeploymentListener)3 TransactionalCommandService (org.jbpm.shared.services.impl.TransactionalCommandService)3 PostConstruct (javax.annotation.PostConstruct)2 DeploymentSyncInvoker (org.jbpm.kie.services.impl.store.DeploymentSyncInvoker)2 DeploymentSynchronizer (org.jbpm.kie.services.impl.store.DeploymentSynchronizer)2 ScheduleExpression (javax.ejb.ScheduleExpression)1 TimerConfig (javax.ejb.TimerConfig)1 DeploymentUnit (org.jbpm.services.api.model.DeploymentUnit)1 ProcessDefinition (org.jbpm.services.api.model.ProcessDefinition)1 Before (org.junit.Before)1 QueryContext (org.kie.api.runtime.query.QueryContext)1 DeploymentDescriptor (org.kie.internal.runtime.conf.DeploymentDescriptor)1