Loading TOC...

alert.createTriggers

alert.createTriggers(
   $uri as String,
   $events as element(trgr.dataEvent)[]
) as Array

Summary

Create triggers that invoke the standard alerting trigger module. The caller must have the alert-admin privilege. The returned trigger IDs must be associated with the config using alert.configSetTriggerIds and then saving the updated config with alert.configInsert.

Parameters
$uriThe URI specified to alert.makeConfig.
$events Events for which to create triggers.

Example

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

  declareUpdate();
  alert.configInsert(
      alert.configSetTriggerIds(
          alert.configGet("http://acme.com/alert/message-board"),
          alert.createTriggers(
             "http://acme.com/alert/message-board", 
              trgr.triggerDataEvent(
                   trgr.directoryScope("/myDir/", "1"),
                   trgr.documentContent("create"),
                   trgr.postCommit()))))
  

Comments

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