Filter in Event Handler
I would like to put a complex filtering in Event Handler in automation, and I see there is “Custom EL Expression”. It seems that default JSF EL not working in it.
Can you tell me how it works ?
You are right JSF EL does not work into this field, Nuxeo used the same language your are using into Automation chains except, you don't need to add @{}.
- So for the currentDocument title: Document.getProperty(“dc:title”)
- Equality with: ==
- String value: with double quote: "
=> so enabled Event Handler if title is toto : Document.getProperty(“dc:title”) == “toto”
- Current user: CurrentUser.name
- Lock Owner: Document.isLocked()
- And: &&
- Or: ||
=> check if lockowner is the current user: Document.isLocked() && Document.doc.getLockInfo().getOwner() == CurrentUser.getName()
- etc…
Nuxeo is conscient that there is different kind of EL language into the platform, we plan to work on a normalization about that.
Hope this helps others Nuxeo users. :D
You should use Document.getProperty instead of Document.getPropertyValue
I'll check if we can make this a tiny little bit more consistent with other APIs…