On Wed, 14 Dec 2011 09:07:30 -0800, Singh, Gurbeer <[email protected]> wrote:
> Hi > I need to write a monitor or something like trigger . Which will send > email to support team if pipeline conversion fails for any documnet. > > Basically, if any error occurred while processing document conversion, > it should send email to some group. > > Currently we have implemented log mechanism, but it’s a unix box and log > is maintained a txt file. One option looks to me write send email logic > on every transaction. > Like in catch block of convertToXHTML.xqy write send email logic. > in catch block of isDocument2007XML write send email logic. > Similar way implement this in all transaction file isDocumentpptx.xqy, > isDocumentdocx.xqy etc.. > > But it’s a repeat ion of work. Also how to send email > > > ~Gurbeer > If you want to send email if a pipeline step fails, a clean way to implement this as an action that responds to the relevant error state. You can either use different error states to respond differently to different kinds of failures or use the cpf:error property to make that determination. You would make a little pipeline that has the action for the relevant error state(s), load and attach it, and put in place the error-handling action(s). Sending email can be done using the xdmp:email builtin. Modules/MarkLogic/samples/alerting/modules/email.xqy has a sample demo:send-email function that you can use as a starting point. //Mary Mary Holstege Principal Engineer MarkLogic Corporation [email protected] www.marklogic.com _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
