Jump to: navigation, search

Configuring GRS for GWE *

8.1.2 vs 8.1.3 Rules Engines

In release 8.1.3 of GRS, additional Genesys Rules Engine (GRE) functionality is introduced to enable GRS to be fully compatible with Genesys Web Engagement (GWE). In release 8.1.2, support for additional CEP template types was introduced in anticipation of this new 8.1.3 functionality.

In 8.1.3 there is still a single GRE component and deliverable, but there are some additional software artifacts that may require some configuration effort. In effect, a second rules engine for CEP is delivered, so release 8.1.3 has a combined rules engine.

The pre-8.1.3 implementation of GRE (standard) and the 8.1.3 implementation (CEP) differ in how a deployed rules package is maintained. The standard rules engine writes serialized objects to file. The additional GWE CEP rules engine writes to file the DRL in the format it is received from GRAT.

In the 8.1.3 combined rules engine the rules package will be maintained in its DRL form. A user of the new engine will have to redeploy all standard rule packages previously deployed to the old engine.

Deployment

Deployment of a rules package is the same as for release 8.1.2.

Rule Package Execution

The posts made by the standard and the CEP engine are different:

To execute standard rules a ServiceRequestMessage object is posted to:

genesys-rules-engine/knowledgebase/{rulePackageName}

This ServiceRequestMessage may be either XML or JSON encoded. A ServiceResponseMessage object is returned as a response.

To execute CEP rules an Event object is sent, via get or post, to the following URL:

genesys-rules-engine/cep/event/{globalID}/{visitID}

This Event object is expected to be JSON encoded. The globalID and visitID parameters are optional. If not specified new values will be assigned. The name of the rules package to execute must be set within the Event object. A JSON object containing any assigned globalID and/or visitID is returned as a response.

The Event Object

The EventInterface class describes the methods that are required by GRS to be defined within the Event class. The Event-related classes are included in the software distribution, so users will be able to modify the Event class to suit their needs. The EventInterface class looks like this:

public interface EventInterface {
    public static final String TYPE_BASIC = "basic";
    public static final String TYPE_SYSTEM = "system";
    public static final String TYPE_ACTIONABLE = "actionable";
 
    public ObjectNode asJsonObject();
    
    public String getName(); 
    public void setName(String value);
 
    public String getPackageName();
    public void setPackageName(String value);
    
    public String getType();
    public void setType(String value);
 
    public String getVisitId();
    public void setVisitId(String value);
 
    public String getGlobalVisitId();
    public void setGlobalVisitId(String value);
 
    public long getTimestamp();
    public void setTimestamp(long value);
   
    public String getPhase();
    public void setPhase(String value);
    
    public String getBusinessContextLevel1();
    public void setBusinessContextLevel1(String value);
       
    public String getBusinessContextLevel2();
    public void setBusinessContextLevel2(String value);
}

Additional Software Components and Configuration

Three .jars and a .war are included in the software distribution:

  • A .jar containing Event-related classes. This will need to be included in GRAT so that Event and EventInterface are visible.
  • A .jar containing the CEP engine
  • A .jar containing the standard engine
  • A .war that contains the above three .jars and all dependencies needed for deployment.

GWE should include the Event and CEP engine .jars into their deliverable.

Spring Beans Configuration

Spring Beans are used to define the components and to marry them together.

GWE should customize the Bean configuration to suit their needs. The default Spring xml looks like this:

    <context:property-placeholderlocation="classpath:cep.properties"/>
    <context:component-scanbase-package="com.genesyslab.brs.cep.monitoring"/>
 
    <beanid="cep.ObjectMapper"class="org.codehaus.jackson.map.ObjectMapper"/>
    <beanid="cep.UUIDGenerator"class="com.genesyslab.brs.cep.common.DefaultUUIDGenerator"/>
    <beanid="cep.CepEngine"factory-bean="cep.EngineFacade"factory-method="createCepEngine"/>
    <beanid="standardRulesEngine"factory-bean="cep.EngineFacade"factory-method="createStandardRulesEngine"/>
    <beanid="cep.EventSender"class="com.genesyslab.brs.cep.monitoring.OutputEventSender">
        	<constructor-arg value="${event-target-url}"/>
    </bean>
    <beanid="cep.CepEventListener"class="com.genesyslab.brs.cep.monitoring.CepEventListenerImpl">
        	<constructor-arg ref="cep.EventSender"/>
    </bean>
    <beanid="cep.BusinessRuleProvider"class="com.genesyslab.brs.cep.monitoring.RuleRepository">
        	<constructor-arg value="${deployed-rules-directory}"/>
    </bean>
    <beanid="cep.ResourceEventProcessor"
         	 class="com.genesyslab.brs.cep.monitoring.rest.CepResourceEventProcessor">
        	<constructor-arg ref="cep.ObjectMapper"/>
        	<constructor-arg ref="cep.UUIDGenerator"/>
        	<constructor-arg ref="cep.CepEngine"/>
    </bean>
    <beanid="cep.ConfigConnector"class="com.genesyslab.brs.common.cme.ConfigurationServerConnectorImpl">
        	<constructor-arg value="${bootstrap-Id}"/>
    </bean>    
    <beanid="cep.EngineFacade"class="com.genesyslab.brs.cep.monitoring.EngineFacade">
        	<constructor-arg ref="cep.CepEventListener"/>
        	<constructor-arg ref="cep.BusinessRuleProvider"/>
        	<constructor-arg ref="cep.ConfigConnector"/>        
    </bean>

Notes

  • Define both the cep.CepEngine bean and the standardRulesEngine bean to include both engines. If you want to use only one engine, then include only one of these definitions.
  • The cep.ConfigConnector parameter to EngineFacade is optional. If included then configuration key/values are obtained from the CME application identified by the specified bootstrap-ID in the bootstrapconfig.xml file. If cep.ConfigConnector is not used then configuration key/values are retrieved from the local cep.properties file.
  • An optional fourth parameter to the cep.ResourceEventProcessor bean allows the specification of an EventSender object. If this EventSender object is specified, then once processing for each event is complete, the event is forwarded to this EventSender object for whatever processing is desired outside of the engine.

This page was last edited on June 6, 2013, at 11:37.
Comments or questions about this documentation? Contact us for support!