Trigger an automation script when a child is created or deleted from a folderish document
I try to trigger an automation script when a child is added or deleted from a folderish custom document. I have a simple automation script with a console.log message to test the trigger.
I've created an event handler with document.modified event in Nuxeo Studio. In event handler activation, I've selected the local type of my custom folderish document.
In Web Ui, when i add a new document on this folderish document, the automation script is triggered (i see my console.log message in the server.log file) but when i delete a document in the same folderish document, there is no trigger.
I've also tried the Event Children order changed with no results.
Do you have any suggestion to handle this trigger ?
Thanks in advance for your help.
In this case, it's more suitable to add an event handler on the children document rather than the container: In your event handler condition, just add a filter checking the parent document type, and it's OK.
For the events you would have to listen, you should have
Document trashed ,
Document imported. If you want to track if a children is modified, you have to listen to the
Before document modification event (make sure you're not saving anything in the corresponding automation chain). If you listen to the
Document modified, there's some chances you're running into infinite loops.
Thanks for the ticket ! I keep in mind the custom event importation, but as far as possible i wish to set my project with a “standard” configuration.
See screenshot: there's indeed a formatting issue, I'm gonna create a JIRA ticket to fix it.
Remember also you can always import custom events from the Studio Event Registry.