Loading TOC...

alert.ruleInsert

alert.ruleInsert(
   $config-uri as String,
   $rule as Object
) as null

Summary

This function inserts rule into the database associated with the specified alerting configuration. A user must have the alert-user privilege to call this function.

Parameters
$config-uriThe URI passed to alert.makeConfig.
$rule The representation of a rule.

Example

  var alert = require("/MarkLogic/alert.xqy");

  declareUpdate();
  alert.ruleInsert(
       "http://acme.com/alert/message-board",
        alert.makeRule(
            "nucleic acids email", 
            "Alert me to anything concerning nucleic acids", 
            "0",
             cts.orQuery([
                  cts.wordQuery("dna"),
                  cts.wordQuery("rna")]),  
             "sms", 
             {"emailAddress":"me@somedomain.com"}))
  

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy