cancel
Showing results for 
Search instead for 
Did you mean: 

How to validate the document creation with unique uid using automation chain

geekonspace
Star Contributor
Star Contributor

Hello, I need validate the creation of documents with unique uid. I need to use a condition on automation chain for verify the uid on documents in the repository but I don´t know how to do that? I have reviewed all operations in studio but I don't see something with conditions

1 ACCEPTED ANSWER

Fred_Vadon
Star Contributor
Star Contributor

Another way of doing it is to create the id automatically using Fn.getNextId (maybe using the metadata of the document) so that you will be sure to have a unique id. Find here an example on custom doc id generation : http://doc.nuxeo.com/x/pQM7

View answer in original post

4 REPLIES 4

Laurent_Doguin
Star Collaborator
Star Collaborator

Hi,

Since studio is using MVEL, i guess you can use the usual MVEL synthx for conditions: http://docs.codehaus.org/display/MVEL/MVEL+2.0+Control+Flow

Fred_Vadon
Star Contributor
Star Contributor

Another way of doing it is to create the id automatically using Fn.getNextId (maybe using the metadata of the document) so that you will be sure to have a unique id. Find here an example on custom doc id generation : http://doc.nuxeo.com/x/pQM7

what I want to do is first search in the repository for a document with uid = metadata value in my current document, if I find another document with the same uid then my current document shouldn't be created. This uid always is get from another value of metadata that user write

Alain_ESCAFFRE
Star Contributor
Star Contributor

Doing the "count" fo your select is something that can be done easily with automation (using This.size() for exemple) but the problem is more that we don't currently any operation that would break the transaction nicely. The best option would be to write a JSF validator that does what you meant and reference it in the "validator" property of your widget. This is development with Nuxeo IDE.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.