Jump to: navigation, search

Publishing the CEP Rule Templates

After you create business information by following either the Simple Engagement Model or the Advanced Engagement Model, you can begin working with the CEP Rule Templates.

Even if you do not plan to customize the CEP rule templates, you still need to import, configure, and publish them in the rules repository so that they are available when you begin creating your rules. You can do this in two different ways:

  • Import the default CEP rule template into the Genesys Rules Authoring Tool (GRAT) and then use it as is. This is known as the simple mode of default CEP rule template publishing.
  • Use the Genesys Rules Development Tool (GRDT) to import the default CEP rule template, then modify it and publish to the GRAT repository. This is known as the advanced mode of CEP rule template publishing.

Simple mode of default CEP rule template publishing

If you do not plan to introduce new business events and will use only those available in the out-of-the-box DSL file—or if you just want to get off to a quick start with the default CEP rule template, without using GRDT—you can use the simple mode of default CEP rule template publishing, which only requires GRAT.

Here's how:

  1. Verify that gwe_default_grat_template.xml is present in Web Engagement installation dir\apps\your application\resources\_composer-projects\WebEngagement_CEPRule_Templates\import. This file contains the default Web Engagement CEP rule templates.
  2. Open GRAT and select the Environment element from the left pane. The Import Templates button appears in the right pane.

    GRAT Import Templates Button


  3. Click Import Templates.
  4. Browse to gwe_default_grat_template.xml, then then click the Import button:

    GRAT Import Templates Dialog


  5. If the template file was successfully imported, you will see a confirmation dialog:

    GRAT Confirmation Dialog


  6. You can now create your own rule package, based on the imported CEP rule template:

    New Rule Package


Advanced mode of CEP rule template publishing

To use the advanced mode, do this:

  1. Read the overview information about the rule templates.
  2. Importing the CEP Rule Templates in GRDT.
  3. Configuring the CEP Rule Templates.
  4. If necessary, you can Customize the CEP Rule Templates.
  5. Publishing the CEP Rule Templates in the Rules Repository.

Overview

The Complex Event Processing (CEP) Rule Templates define the actions and conditions you can use when you create your business rules in Genesys Rules Authoring Tool.

You use the Genesys Rules Authoring Tool (GRAT) to develop, author, and evaluate these business rules. A business rule is a piece of logic defined by a business analyst. These rules are evaluated in a Rules Engine based upon requests received from client applications such as Genesys Web Engagement. A newly created Web Engagement application contains a pre-defined CEP (Complex Event Processing) template. This template type enables rule developers to build templates that rule authors then use to create rules and packages. These rules use customized event types and rule conditions and actions. Each rule condition and action includes the plain-language label that the business rules author will see, as well as the rule language mapping that defines how the underlying data will be retrieved or updated.

By default, your newly created Web Engagement application contains the following CEP Rule Template:

  • \apps\application name\resources\_composer-projects\WebEngagement_CEPRule_Templates includes a GRDT-based project with CEP templates.
CEP rule template in Composer

In order to use these templates to define rules, you must first publish them.

Before you publish the templates, you can edit them to suit your business needs using the the Genesys Rules Development Tool. For more information about rule templates, refer to the Genesys Rules System documentation.

Important
Note that if you customize your rule templates, you must republish them.

Actions

The list of actions available in the template is listed in WebEngagement_CEPRule_Templates > Actions. You can edit, add, or remove these actions. In the Genesys Rules Authoring Tool (GRAT), when you create a rule based on the template, you can add an action by clicking Add action; GRAT displays all the actions defined in the template. You'll see how actions are implemented once you start creating rules. The default actions are:

  • Generate Actionable Event
  • Generate Actionable Event Predefined

Enums

The enumerations available in the template are listed in WebEngagement_CEPRule_Templates > Enums. You can edit, add, or remove these enumerations. When you create a rule based on the template, you can specify a Phase by clicking Add Linear Rule; GRAT displays all the enumerates available in the template. In the default template, no specific enumeration is available.

Conditions

The conditions are listed in WebEngagement_CEPRule_Templates > Conditions.


List of conditions in the CEP rule template.

You can edit, add, or remove these conditions. Each condition associates a name with an expression. When you create a rule based on the template, you can add one or more condition to this rule by clicking Add condition; GRAT displays all the condition expressions available in the template. For complex templates, you need several conditions to implement a rule.

Condition Details
Condition Name Expression Condition details
Check search string event searches {searchString} Returns true if the event Search occurs and if the {searchString} label is found, this event's result is saved in the {event} label.
Following event with category AND event following {prevEvent} with category {category} save as {event} If the event follows {prevEvent} and contains the {category} label, this event's result is saved in the {event} label.
Following event with name AND event following {prevEvent} with name {eventName} save as {event} If the {eventName} follows {prevEvent} in parameter, this event's result is saved in the {event} label.
Has Category page transition event occurs that belongs to category {category} save as {event} If the event is a page transition for the given category, this event's result is saved in the {event} label.
Has Category without save page transition event occurs that belongs to category {category} Returns true if the event is a transition to the given category's page.
Has Name event with name {eventName} save as {event} If the {eventName} occurs, this event's result is saved in the {event} label. 
Has Name without save AND event with name {eventName} Returns true if  {eventName} occurs.
Remember last event Precondition: save last event Saves the last event.
Save category as event category is {category} save as {event} If the event contains the given category, this event's result is saved in the {event} label.
Timeout on category Timeout event occurs with category {category} Returns true if the Timeout event occurs for the given category.

Importing the CEP Rule Templates in GRDT

Complete this procedure to import the CEP rule templates in the Genesys Rules Development Tool. Even if you do not plan to customize the templates, your rule template must be published in the Rules System Repository before you try to create rules.
Prerequisites

Start

  1. Navigate to Window > Open Perspective > Other > Template Development to switch to the Template Development perspective of the Genesys Rules Development Tool.
  2. Select File > Import....
  3. In the Import dialog window, navigate to General > Existing Projects into Workspace. Click Next.
  4. Select Select Root Directory:, then click Browse.
  5. Import your project from Web Engagement installation directory\apps\application name\resources\_composer-projects\WebEngagement_CEPRule_Templates:
    • Browse to the \apps\application name\resources\_composer-projects folder in the Genesys Web Engagement installation directory and select a project.
    • Click OK. WebEngagement_CEPRule_Templatesapplication name is added to the Projects list.
    • Select the WebEngagement_CEPRule_Templatesapplication name project.
    • Warning: Do not enable the option Copy projects into workspace.

      Import the default templates by clicking Finish.
    • Click Finish to import the project. WebEngagement_CEPRule_Templatesapplication name is added to the Project Explorer.

      WebEngagement_CEPRule_Templatesapplication name is added to the Project Explorer.

End

Configuring the CEP Rule Templates

Prerequisites

  • The Web Engagement Categories business attribute is defined in Genesys Administrator.

Start

  1. In the GRDT Project Explorer, right-click on the WebEngagement_CEPRule_Templatesapplication name project. Click Properties.
  2. In the Properties dialog window, navigate to Template Properties. In Publishing Data, set Type to web_engagement.

    Set the type to web_engagement.
  3. Navigate to Template Properties > Imports. The Imports panel opens.
  4. Select the Enable global imports option.

    Enabling global imports.

    Note: The com.genesyslab.wme.cep.api.Event and com.genesyslab.wme.cep.drools.EventDispatcher packages must be present.
  5. Click OK.
  6. In the Project Explorer, navigate to WebEngagement_CEPRule_Templatesapplication name > Parameters > category.

    Set the Attribute Name for Web Engagement
  7. In the Parameters Editor panel, set Attribute Name to Web Engagement Categories.

    Set the Attribute Name for Web Engagement
  8. Click Save.

End

Customizing the CEP Rule Templates (Optional)

Start

  1. Open the CEP rule template project with GRDT and navigate to the Conditions item.
  2. Expand Conditions to open the Conditions editor.
  3. In the Conditions tab, click +. The Add Condition window opens.

    Add a condition
  4. Enter a name and click OK. The condition is added and selected in the condition list; the condition detail panel opens.
  5. Insert the Language Expressions and Rule Language Mapping:

    Gwe-insert condition expression.png
  6. Click Save Now when the rule template is published, the rule will be available in GRAT:

    The new rule is available for use in GRAT.

End

Publishing the CEP Rule Templates in the Rules Repository

Prerequisites

Start

  1. In Project Explorer, right click WebEngagement_CEPRule_Templatesapplication name.
  2. Select Publish. The Publish Template Wizard opens.

    The Publish Template Wizard.
  3. Select WebEngagement_CEPRule_Templatesapplication name.

    Select WebEngagement_CEPRule_Templatesapplication name.
  4. Click Finish.

End

Next Steps

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on 7 October 2016, at 12:44.