Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

Facilities
FacilityIdOrganizationIdNameTimezoneNFCEnabledNFCSelfModificationEnabledBarCodeEnabled
ACME-PHACME

 Pearl Harbor

US/Hawaii

truefalsefalse

...

Code Block
languagexml
linenumberstrue
<bean id="ACME" class="org.drools.mas.core.DroolsAgentConfiguration$SubSessionDescriptor">
    <constructor-arg value="subsession-acme"/>
    <constructor-arg value="ACME-change-set.xml"/>
    <constructor-arg value="${agent.node}"/>
    <constructor-arg>
        <map>
            <entry key="organizationId" value="ACME"/>
        </map>
    </constructor-arg>
</bean>
...
<bean id="${agent.name}-configuration" class="org.drools.mas.core.DroolsAgentConfiguration">
    <property name="agentId" value="${agent.name}"/>
    <property name="changeset" value="agent_changeset.xml" />
    <!-- by default the mindNodeLocation is local --> 
    <property name="mindNodeLocation" value="${agent.node}"/>
    <property name="subSessions">
        <list>
            ...
            <ref local="${agent.name}-unc"/>
        </list>
    </property>
</bean>

Important notes about the contextApplication.xml file:

  • Line #1 defines the new sub-session for ACME organization.
  • Line #20 includes this new sub-session as part of the main session of the agent.

The last step is to add the routing statement in agent_cbr.drl:

 

Code Block
languagejava
linenumberstrue
rule "Mapping"
when
then
    ...
    insert( new SessionMapping("ACME","subsession-acme") );
    RulesLoggerHelper.debug(logger, drools, "Subsession mapping created for 'ACME');
    ... 
end