
alert.makeAction( 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.
var alert = require("/MarkLogic/alert.xqy");
alert.makeAction(
"sms",
"Sends basic SMS text message",
xdmp.modulesDatabase(),
xdmp.modulesRoot(),
"/modules/sms.xqy",
{
"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: Get the most useful answers to questions from the MarkLogic community, or ask your own question.