Verint | Telligent Community
Verint | Telligent Community
  • Site
  • User
  • Site
  • Search
  • User
Telligent Community 9.x
  • Verint Community
Telligent Community 9.x
Developer Training Extending Rule Support
  • Ask the Community
  • User Documentation
  • API Documentation
  • Manager Training
  • Developer Training
  • Tags
  • More
  • Cancel
  • New
  • +Getting Started
  • +External Integration
  • -Plugins/Framework extension
    • +Setting Up Your Development Environment
    • -Plugins
      • Plugin Lifecycle
      • -Plugin Examples
        • Creating Activity Stories
        • +Creating Custom Applications and Content
        • Defining Permissions
        • Exposing Configuration Options
        • Exposing Data to External Sources
        • Extending Rule Support
        • File Viewers
        • Handling Embedded Files in Content
        • Handling Events
        • Interacting With Files
        • Managing Dependencies
        • Managing Physical File Storage
        • Notifications
        • Registering Tokens for Templates
        • Template-based Email
        • Translating Plugin Text
        • Using Widgets to Render Content From Plugins
      • Exceptions and Logging
    • +In-Process API
  • +UI Customization

Extending Rule Support

A rule is an automatic action that Community Server performs in response to platform triggers and conditions specified in the Rules tab of the Control Panel. They consist of three parts, a trigger (IRuleTrigger), a condition (IConfigurableRuleCondition) and an action (IConfigurableRuleAction).

Table of Contents

  • Why Should I Create a Rule?
  • Creating a Rule

Why Should I Create a Rule?

When you want to allow users to setup actions that can be performed automatically without having to write code for an event handler then the solution would be to create a rule trigger, condition or action. Some of the out-of-the-box rules allow you to award a number of points for publishing a blog post. Or you could send a congratulatory email for liking a piece of content. There are many scenarios that can be accomplished with rules.

Creating a Rule

When the trigger occurs, the condition(s) is/are evaluated and then, if met, the action(s) are executed. In addition, a rule can enabled or disabled as necessary.

The rule trigger takes advantage of an event hander to fire the rule. In this sample the rule is triggered after a user is created. The two main factors in the trigger are the RuleTriggerExecutionContext and the IRuleController. The RuleTriggerExecutionContext collects and sets the data that will be passed along to the other parts of the rule. The IRuleController allows you to actually trigger the rule. This is typically used along with an event handler. You can think of the trigger as the When part of the rule statement.

https://community.telligent.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-07-14/MyRuleTrigger_2E00_cs

This is a simple rule condition, it evaluates two strings and checks for equality. The condition has three main members. The ConfigurableValues property which allows you to setup the controls that will be displayed in the UI for configuring the condition. This is followed by the Evaluate method which determines if the rule should continue executing. It accepts an IRuleExecutionRuntime argument that is used to retrieve the PropertyGroup array returned by the ConfigurableValues. Finally you'll need to return a PrimativeType in the RequiredPrimitiveType property. You can think of the condition as the If part of the rule statement.

https://community.telligent.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-07-14/MyRuleCondition_2E00_cs

Once the rule trigger and condition are satisfied then the action can take place. The main section if the action is the Execute method. It is what performs the action based on the IRuleExecutionRuntime argument that was setup in the trigger. You can think of the action as the Then part of the rule statement.

https://community.telligent.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-07-14/4073_2E00_MyRuleAction_2E00_cs

Here is the result of the plugins displayed in the UI when creating a new rule.

  • Share
  • History
  • More
  • Cancel
Related
Recommended
  • Telligent
  • Professional Services
  • Submit a Support Ticket
  • Become a Partner
  • Request a Demo
  • Contact Us

About
Privacy Policy
Terms of use
Copyright 2022 Verint, Inc.
Powered by Verint Community