Search in sources :

Example 1 with NotifyParentCaseEventListener

use of org.jbpm.casemgmt.impl.wih.NotifyParentCaseEventListener in project jbpm by kiegroup.

the class CaseConfigurationDeploymentListener method onDeploy.

@Override
public void onDeploy(DeploymentEvent event) {
    InternalRuntimeManager runtimeManager = (InternalRuntimeManager) event.getDeployedUnit().getRuntimeManager();
    if (runtimeManager instanceof PerCaseRuntimeManager) {
        List<CaseEventListener> caseEventListeners = getEventListenerFromDescriptor(runtimeManager);
        logger.debug("Adding following case event listeners {} for deployment {}", caseEventListeners, event.getDeploymentId());
        TransactionalCommandService commandService = transactionalCommandService;
        if (commandService == null) {
            commandService = new TransactionalCommandService(((SimpleRuntimeEnvironment) runtimeManager.getEnvironment()).getEmf());
        }
        CaseInstanceAuditEventListener auditEventListener = new CaseInstanceAuditEventListener(commandService);
        caseEventListeners.add(auditEventListener);
        caseEventListeners.add(new NotifyParentCaseEventListener(identityProvider));
        CaseEventSupport caseEventSupport = new CaseEventSupport(identityProvider, caseEventListeners);
        ((PerCaseRuntimeManager) runtimeManager).setCaseEventSupport(caseEventSupport);
        logger.debug("CaseEventSupport configured for deployment {}", event.getDeploymentId());
    }
}
Also used : SimpleRuntimeEnvironment(org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment) InternalRuntimeManager(org.kie.internal.runtime.manager.InternalRuntimeManager) PerCaseRuntimeManager(org.jbpm.runtime.manager.impl.PerCaseRuntimeManager) CaseInstanceAuditEventListener(org.jbpm.casemgmt.impl.audit.CaseInstanceAuditEventListener) TransactionalCommandService(org.jbpm.shared.services.impl.TransactionalCommandService) NotifyParentCaseEventListener(org.jbpm.casemgmt.impl.wih.NotifyParentCaseEventListener) CaseEventListener(org.jbpm.casemgmt.api.event.CaseEventListener) NotifyParentCaseEventListener(org.jbpm.casemgmt.impl.wih.NotifyParentCaseEventListener)

Aggregations

CaseEventListener (org.jbpm.casemgmt.api.event.CaseEventListener)1 CaseInstanceAuditEventListener (org.jbpm.casemgmt.impl.audit.CaseInstanceAuditEventListener)1 NotifyParentCaseEventListener (org.jbpm.casemgmt.impl.wih.NotifyParentCaseEventListener)1 PerCaseRuntimeManager (org.jbpm.runtime.manager.impl.PerCaseRuntimeManager)1 SimpleRuntimeEnvironment (org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment)1 TransactionalCommandService (org.jbpm.shared.services.impl.TransactionalCommandService)1 InternalRuntimeManager (org.kie.internal.runtime.manager.InternalRuntimeManager)1