Search in sources :

Example 1 with AbstractEventSupport

use of org.drools.core.event.AbstractEventSupport in project droolsjbpm-integration by kiegroup.

the class SpringKModuleDeploymentService method notifyOnDeploy.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void notifyOnDeploy(DeploymentUnit unit, DeployedUnit deployedUnit) {
    super.notifyOnDeploy(unit, deployedUnit);
    InternalRuntimeManager runtimeManager = (InternalRuntimeManager) deployedUnit.getRuntimeManager();
    if (runtimeManager instanceof PerCaseRuntimeManager) {
        AbstractEventSupport eventSupport = ((PerCaseRuntimeManager) runtimeManager).getCaseEventSupport();
        Map<String, CaseEventListener> foundBeans = context.getBeansOfType(CaseEventListener.class);
        for (CaseEventListener listener : foundBeans.values()) {
            eventSupport.addEventListener(listener);
            logger.debug("Registering {} as case event listener on {}", listener, runtimeManager.getIdentifier());
        }
    }
}
Also used : InternalRuntimeManager(org.kie.internal.runtime.manager.InternalRuntimeManager) PerCaseRuntimeManager(org.jbpm.runtime.manager.impl.PerCaseRuntimeManager) AbstractEventSupport(org.drools.core.event.AbstractEventSupport) CaseEventListener(org.jbpm.casemgmt.api.event.CaseEventListener)

Example 2 with AbstractEventSupport

use of org.drools.core.event.AbstractEventSupport in project himss_2021_sepsis_detection by redhat-na-ssa.

the class SpringKModuleDeploymentService method notifyOnDeploy.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void notifyOnDeploy(DeploymentUnit unit, DeployedUnit deployedUnit) {
    super.notifyOnDeploy(unit, deployedUnit);
    InternalRuntimeManager runtimeManager = (InternalRuntimeManager) deployedUnit.getRuntimeManager();
    if (runtimeManager instanceof PerCaseRuntimeManager) {
        AbstractEventSupport eventSupport = ((PerCaseRuntimeManager) runtimeManager).getCaseEventSupport();
        Map<String, CaseEventListener> foundBeans = context.getBeansOfType(CaseEventListener.class);
        for (CaseEventListener listener : foundBeans.values()) {
            eventSupport.addEventListener(listener);
            logger.debug("Registering {} as case event listener on {}", listener, runtimeManager.getIdentifier());
        }
    }
}
Also used : InternalRuntimeManager(org.kie.internal.runtime.manager.InternalRuntimeManager) PerCaseRuntimeManager(org.jbpm.runtime.manager.impl.PerCaseRuntimeManager) AbstractEventSupport(org.drools.core.event.AbstractEventSupport) CaseEventListener(org.jbpm.casemgmt.api.event.CaseEventListener)

Aggregations

AbstractEventSupport (org.drools.core.event.AbstractEventSupport)2 CaseEventListener (org.jbpm.casemgmt.api.event.CaseEventListener)2 PerCaseRuntimeManager (org.jbpm.runtime.manager.impl.PerCaseRuntimeManager)2 InternalRuntimeManager (org.kie.internal.runtime.manager.InternalRuntimeManager)2