Judie,

The error indicates that the trigger is not associated with any alerting
configuration. Here is some example code showing creation of create and
modify triggers. The last three lines are key to associate the triggers
with your alerting configuration.

        xquery version "1.0-ml"; 
        
        import module namespace alert = "http://marklogic.com/xdmp/alert"; 
          at "/MarkLogic/alert.xqy";
        
        let $uri := "http://acme.com/alert/message-board";
        let $trigger-ids :=
          alert:create-triggers (
            $uri,
            trgr:trigger-data-event(
              trgr:directory-scope("/", "infinity"),
              trgr:document-content(("create", "modify")),
              trgr:pre-commit())))
        let $config := alert:config-get($uri)
        let $new-config := alert:config-set-trigger-ids($config, $trigger-ids)
        return alert:config-insert($new-config)

Also note that by using a post-commit trigger, the document is already
gone from the database and you won't be able to match any alerting rules
to it. You may want to try a precommit trigger.

Wayne.


On Mon, 2009-10-26 at 05:12 -0700, judie pearline wrote:

> Hi all,
>  
> I have created an alert trigger for a document delete. when i tried to
> delete a document its throwing some error in the log.
>  
> Since the trigger was set to call at post commit, the document is
> getting deleted but the action was not occured.
>  
> Error Log:
> ----------------
> ALERT-TRIGGER (err:FOER0000): unknown trigger
>  in /MarkLogic/alert/trigger.xqy, on line 22,
>  in alert:do-trigger("/hamlet.doc", <trgr:trigger
> xmlns:trgr="http://marklogic.com/xdmp/triggers";><trgr:trigger-id>17475202855453881487</trgr:trigger-id><trgr:tri...</trgr:trigger>)
>  [1.0-ml]
> $uri = "/hamlet.doc"
> $trigger = <trgr:trigger
> xmlns:trgr="http://marklogic.com/xdmp/triggers";><trgr:trigger-id>17475202855453881487</trgr:trigger-id><trgr:tri...</trgr:trigger>
>  $doc = ()
>  $alert-uris = ()
>  $when = text{"post-commit"}
>  in /MarkLogic/alert/trigger.xqy, on line 39 [1.0-ml]
>  
> Please suggest.
>  
> Regards,
> Judie
> 
> 
> ______________________________________________________________________
> Connect more, do more and share more with Yahoo! India Mail. Learn
> more.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to