Search in sources :

Example 6 with DeploymentDescriptorManager

use of org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorManager in project jbpm by kiegroup.

the class TransactionalCommandServiceProducer method produceAuditCommandService.

@Produces
@Audit
public TransactionalCommandService produceAuditCommandService() {
    DeploymentDescriptorManager manager = new DeploymentDescriptorManager("org.jbpm.domain");
    DeploymentDescriptor descriptor = manager.getDefaultDescriptor();
    if (!"org.jbpm.domain".equals(descriptor.getAuditPersistenceUnit())) {
        return new TransactionalCommandService(EntityManagerFactoryManager.get().getOrCreate(descriptor.getAuditPersistenceUnit()));
    }
    return new TransactionalCommandService(emf);
}
Also used : DeploymentDescriptor(org.kie.internal.runtime.conf.DeploymentDescriptor) DeploymentDescriptorManager(org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorManager) TransactionalCommandService(org.jbpm.shared.services.impl.TransactionalCommandService) Audit(org.jbpm.services.cdi.Audit) Produces(javax.enterprise.inject.Produces)

Aggregations

DeploymentDescriptorManager (org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorManager)6 DeploymentDescriptor (org.kie.internal.runtime.conf.DeploymentDescriptor)6 EntityManagerFactory (javax.persistence.EntityManagerFactory)4 HashMap (java.util.HashMap)2 SerializablePlaceholderResolverStrategy (org.drools.core.marshalling.impl.SerializablePlaceholderResolverStrategy)2 JPATaskLifeCycleEventListener (org.jbpm.services.task.audit.JPATaskLifeCycleEventListener)2 BAMTaskEventListener (org.jbpm.services.task.lifecycle.listeners.BAMTaskEventListener)2 ObjectMarshallingStrategy (org.kie.api.marshalling.ObjectMarshallingStrategy)2 NamedObjectModel (org.kie.internal.runtime.conf.NamedObjectModel)2 ObjectModel (org.kie.internal.runtime.conf.ObjectModel)2 List (java.util.List)1 PostConstruct (javax.annotation.PostConstruct)1 AmbiguousResolutionException (javax.enterprise.inject.AmbiguousResolutionException)1 Produces (javax.enterprise.inject.Produces)1 PersistenceUnit (javax.persistence.PersistenceUnit)1 InternalKieModule (org.drools.compiler.kie.builder.impl.InternalKieModule)1 ProcessAssetDesc (org.jbpm.kie.services.impl.model.ProcessAssetDesc)1 DeploymentDescriptorMerger (org.jbpm.runtime.manager.impl.deploy.DeploymentDescriptorMerger)1 DeployedAsset (org.jbpm.services.api.model.DeployedAsset)1 Audit (org.jbpm.services.cdi.Audit)1