
alert:make-action( $name as xs:string, $description as xs:string, $module-db as xs:unsignedLong, $module-root as xs:string, $module as xs:string, $options as element(alert:options) ) as element(alert:action)
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:
declare variable $alert:config-uri as xs:string external; declare variable $alert:doc as node() external; declare variable $alert:rule as element(alert:rule) external; declare variable $alert:action as element(alert:action) external;
All actions must accept these external variables.
xquery version "1.0-ml";
import module namespace alert = "http://marklogic.com/xdmp/alert"
at "/MarkLogic/alert.xqy";
alert:make-action(
"sms",
"Sends basic SMS text message",
xdmp:modules-database(),
xdmp:modules-root(),
"/modules/sms.xqy",
<alert:options>
<provider name="T-Mobile" domain="tmomail.net"/>
<provider name="Virgin" domain="vmobl.com"/>
<provider name="Cingular" domain="cingularme.com"/>
<provider name="Sprint" domain="messaging.sprintpcs.com"/>
<provider name="Verizon" domain="vtext.com"/>
<provider name="Nextel" domain="messaging-nextel.com"/>
</alert:options>
)
=> Returns the XML representing an action with the specified information