Table of Contents

Search

  1. Preface
  2. RulePoint
  3. RulePoint Concepts
  4. Using RulePoint
  5. RulePoint Objects
  6. Working with Topics
  7. Working with Connections
  8. Working with Sources
  9. Working with Responders
  10. Working with Responses
  11. Working with Watchlists
  12. Working with Analytics
  13. DRQL
  14. Working with Rules
  15. Working with Alerts
  16. Setting Access Controls
  17. Troubleshooting RulePoint Issues
  18. Connecting to an Ultra Messaging Application
  19. Creating an Ultra Messaging JMS Source

User Guide

User Guide

DRQL Overview

DRQL Overview

In the RulePoint user interface, you can create rules using the rule wizard, templates, and in advanced mode. You can create an advanced rule by writing the rule in the Detect and Respond Query Language (DRQL) syntax of RulePoint. The DRQL of RulePoint has its own syntax and grammar.
A DRQL rule statement consists of WHEN, WITH, and THEN clauses that define the rule. The WHEN clause specifies the topics and the number of events required for each topic. The WITH clause specifies the conditions that must be met. The THEN clause specifies the responses to invoke when the rule activates.
For example, in the following rule when two stock events with a stock symbol of XYZ come into the system, you want to send an email to the address, broker@company.com:
WHEN 2 stock WITH symbol = "XYZ" THEN EmailBrokerResponse WITH to="broker@company.com"
  • The comparison of string literals and topic property string values are case sensitive. For example, when evaluating a rule, xyz does not equal XYZ.
  • To improve readability, the DRQL examples show all keywords and operators, such as WHEN, THEN, and OR in all capital letters. These elements are not case sensitive.
  • The examples in this section assumes the existence of Stock and News topics with the appropriate properties and a well defined email responder service and a response named EmailBrokerResponse.

Example

Consider the statement,
when milk is low, go to grocery store
. In DRQL syntax, the statement is broken down as shown in the following table:
WHEN
WITH
THEN
milk
is low
go to grocery store
If required, you can increase the complexity of each clause, as shown in the following table:
WHEN
WITH
THEN
2% milk
is more than 1/2 empty
go to grocery store tonight
2% milk
is low and past sell-by date
go to grocery store now
You can include multiple topics with different conditions as shown in the following table:
WHEN
WITH
THEN
2% milk
is more than 1/2 empty
go to grocery store tomorrow
eggs
less than a dozen
go to grocery store tomorrow
Consider the following example of a stock rule written using DRQL:
WHEN stock s WITH s.symbol="XYZ" AND s.price > 10 THEN EmailResponse
The following table describes the meaning of each clause in the example:
WHEN
WITH
THEN
WHEN stock s
WITH s.symbol="XYZ" AND s.price > 10
THEN EmailResponse
When a Stock topic event, s, occurs at any time...
When Stock topic event s has a symbol of XYZ and a price greater than $10...
When Stock topic event s has a symbol of XYZ and a price greater than $10, send my defined Email response.
  • When creating rules in Advanced Mode, you must assign an alias to the topic. In this case, s references the topic stock as its alias. This is to differentiate which property to derive from which topic if you have more than one topic.
  • By default, the AND operator takes precedence over the OR operator, but you can change the order of precedence.
  • You must separate consecutive topics and response properties with commas.

0 COMMENTS

We’d like to hear from you!