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 ?

0 votes

1 answers

1516 views

ANSWER



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

1 votes



Answers updated
10/24/2012

I think there is a mistake.

You should use Document.getProperty instead of Document.getPropertyValue

02/04/2013

hmmm don't think so: getPropertyValue is the right API to retrieve a field value.
02/19/2013

Sorry, you're right, i modified the answer.

I'll check if we can make this a tiny little bit more consistent with other APIs…

02/22/2013