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

indexof

indexof

The indexof analytic accesses events with a specific index. An event set lists events from the newest event to the oldest event. For example, when two events are sent, the first older event index is 1 and the latest event index is 0.

Syntax

You have the following options for using an indexof analytic:
  • indexof(event property,event index)
    The following table describes the required and optional arguments:
    Argument
    Required
    Optional
    Description
    event property
    Required
    Assesses any one of the event properties.
    event index
    Required
    Assesses a specific event in an event set.
  • indexof(event property,starting index,ending index)
    The following table describes the required and optional arguments:
    Argument
    Required
    Optional
    Description
    event property
    Required
    Assesses any one of the event properties.
    event index
    Required
    Specifies the index range, from start to end.
The following table provides the datatype for the parameters you can pass:
Parameter Input Options
Datatype
Event property
Real number
Watchlist values
Real number
Example 1
when 2 stock s with indexof(s.prop1,1 ) as result >4 then response with body= “${result}”
The following table describes the result for the event property value that you pass:
Event Property Value
Description
Result
s.prop[1]=5 à 1st event
s.prop[0]=1 à latest event
Verifies if an event property of a specific index is greater than 4.
5
Example 2
when 3 stock s with indexof(s.prop1,0,2 ) as result >4 then response with body= “${result}”
The following table describes the result for the event property value that you pass:
Event Property Value
Description
Result
s.prop[2]=2 à 1st event
s.prop[1]=1 à 2nd event
s.prop[0]=5 à latest event
Verifies whether all the values of an event property in the specified index range is greater than 4.
5

Error Condition

For all topic rules, the compiler cannot perform the index bound check. You get a warning message when the index is out of bounds. If you swap the position of the event index with the event property, for example, if you write an indexof analytic as
indexof(event index,event property)
, the DRQL rule compiles, but results in an error during the runtime.

0 COMMENTS

We’d like to hear from you!