MarkLogic 9 Product Documentation
alert:rule-insert

alert:rule-insert(
   $config-uri as xs:string,
   $rule as element(alert:rule)
) as empty-sequence()

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-uri The URI passed to alert:make-config .
$rule The representation of a rule.

Example

  xquery version "1.0-ml";
  import module namespace alert = "http://marklogic.com/xdmp/alert" 
		  at "/MarkLogic/alert.xqy";

  let $rule := alert:make-rule(
    "nucleic acids email", 
    "Alert me to anything concerning nucleic acids",
    xdmp:user("some_user"), 
    cts:or-query(( cts:word-query("dna"), cts:word-query("rna"))),
    "email",
    <alert:options>
      <alert:email-address>me@somedomain.com</alert:email-address>
    </alert:options>
  )
  return alert:rule-insert("http://acme.com/alert/message-board", $rule)
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy