Loading TOC...


   name as String,
   description as String,
   module-db as (Number|String),
   module-root as String,
   module as String,
   options as Object
) as Object


This function creates the specified action. When a rule associated with the action matches a document, the action's module will be invoked with the following external variables set:

         var configUri;
         var doc;
         var rule;
         var action;

All actions must accept these external variables.

name The name give to the action.
description A text description of the action.
module-db The database ID where the XQuery modules reside. Use xdmp.modulesDatabase to specify the configured database.
module-root The path to the module root. Use to specify the xdmp.modulesRoot configured root.
module The URI of the module to invoke.
options Optional information specific to the action.


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

    "Sends basic SMS text message",
      "provider":[{"name":"T-Mobile", "domain":"tmomail.net"},
                 {"name":"Virgin", "domain":"vmobl.com"},
                 {"name":"Cingular", "domain":"cingularme.com"},
                 {"name":"Sprint", "domain":"messaging.sprintpcs.com"},
                 {"name":"Verizon", "domain":"vtext.com"},
                 {"name":"Nextel", "domain":"messaging-nextel.com"}]
  => Returns the JSON Object representing an action with the specified information

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.