event handler create new Domain

Hello,

I created a event handler to be executed after document creation. It works for type Domain, WorkspaceRoot and Workspace. It executes a custom chain with 2 operations : Context.FetchDocument then Database.InsertData (my custom operation).

When I create a new Domain with Web UI, I see the logs server.log, I noticed thar event handler for WorkspaceRoot is executed before event handler for Domain !

It's strange because the Domain is created before the Workspaces folder.

How can I fix that please ?

Regards.

0 votes

1 answers

802 views

ANSWER



Hello,

I have no idea why the WorkspaceRoot creation event handler is called before the Domain one in Web UI, it doesn't make a lot of sense. That said, I strongly advice you to use automation scripting instead of automation chains for this kind of logic. In automation scripting, you can add a condition to understand which event is invoking the automation scripting like here https://github.com/nuxeo/nuxeo-studio-community-cookbook/blob/master/modules/nuxeo/custom-views/modeler/AS_AddCustomView.js#L7 or there https://github.com/nuxeo/nuxeo-studio-community-cookbook/blob/5af93593688d42286a8441f6eff473aec55228a0/modules/nuxeo/modeler-tips-tricks/README.md.

Regards

1 votes