<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:kie="http://drools.org/schema/kie-spring"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                          http://drools.org/schema/kie-spring http://drools.org/schema/kie-spring.xsd">

  <!--
      Inappropriate order of listeners; required order is:
      1) agenda
      2) process
      3) working memory

      But when configured this way, order does not matter:

      <kie:eventListeners id="listeners">
          <kie:agendaEventListener>
              <bean class="org.kie.container.container.spring.MockAgendaEventListener"/>
          </kie:agendaEventListener>
          <kie:ruleRuntimeEventListener>
              <bean class="org.kie.container.container.spring.MockRuleRuntimeEventListener" />
          </kie:ruleRuntimeEventListener>
          <kie:processEventListener>
              <bean class="org.kie.container.container.spring.MockProcessEventListener" />
          </kie:processEventListener>
      </kie:eventListeners>

      <kie:ksession id="session2" type="stateful" listeners="listeners" kbase="kbase"/>

      This behavior should be united.
  -->
  <kie:kmodule id="listeners_orders_module">

    <kie:kbase name="drl_kiesample" packages="drl_kiesample">

      <kie:ksession name="ksession2">
        <kie:agendaEventListener>
          <bean class="org.kie.spring.mocks.MockAgendaEventListener"/>
        </kie:agendaEventListener>
        <kie:ruleRuntimeEventListener>
          <bean class="org.kie.spring.mocks.MockRuleRuntimeEventListener"/>
        </kie:ruleRuntimeEventListener>
        <kie:processEventListener>
          <bean class="org.kie.spring.mocks.MockProcessEventListener"/>
        </kie:processEventListener>
      </kie:ksession>

    </kie:kbase>

  </kie:kmodule>

  <bean id="kiePostProcessor" class="org.kie.spring.KModuleBeanFactoryPostProcessor"/>

</beans>
