<?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">


  <bean id="person" class="org.kie.spring.beans.Person">
    <constructor-arg type="java.lang.String" index="0" value="HAL"/>

    <property name="happy" value="false"/>
  </bean>

  <bean id="person2" class="org.kie.spring.beans.Person">
    <constructor-arg type="java.lang.String" index="0" value="HAL2"/>

    <property name="happy" value="false"/>
  </bean>

  <bean id="personsList" class="java.util.ArrayList"/>

  <kie:kmodule id="kbase_commands">

    <kie:kbase name="drl_kiesample3" packages="drl_kiesample3">
      <kie:ksession name="ksession2" type="stateful">
        <kie:batch>
          <kie:insert-object ref="person"/>
        </kie:batch>
      </kie:ksession>

      <kie:ksession name="ksessionForCommands" type="stateful">
        <kie:batch>
          <kie:insert-object ref="person2"/>
          <kie:set-global identifier="persons" ref="personsList"/>
          <kie:fire-all-rules max="10"/>
        </kie:batch>
      </kie:ksession>

      <kie:ksession name="statlessKsessionWithGlobal" type="stateless">
        <kie:batch>
          <kie:set-global identifier="persons" ref="personsList"/>
        </kie:batch>
      </kie:ksession>
    </kie:kbase>
  </kie:kmodule>

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

</beans>
