How do I read a document's UID into a context variable?
I've tried:
Value: expr:@{Document[“uid:uid”]} in a Execution Context > Set Context variable (traindocuid) and get a blank(null?) when I use the traindocid variable in a User Interface > Add Info message as a check.
Message value is: traindocuid = @{traindocuid}. For the output, I get “traindocuid = " then nothing. No errors are generated on the screen or in the logs.
As a sanity check I substituted: expr:@{Document[“dc:title”]} in the Set Context Variable and this works as expected.
Am I missing something?
Could it be related to the following bug https://jira.nuxeo.com/browse/NXS-908, fixed recently and released in the middle of next week on Studio ?
In short: Studio displays that the document HAS the uid schema while it is not the case. you could use another metadata or wait for the fix to be released.
Followup Question: Why does Nuxeo Shell show, in my "folder extended" documents, a UID field populated with a number when I do a cat -all ?
For your follow up question: the "uid" displayed with the cat command is not the uid:uid property but the doc ID. To display the doc ID in a layout configured with Studio, you can pickup in the schema "system", the field "Document ID"
Thanks for the help !!!!
Looks like expr:Document.getId() for value in Execution Context -> Set Context Variable get's me what I needed.
I didn't realize there was more that one uid property, the “system” uid is the uid I needed.
Karl
Could it be that in the first one you set up “traindocid” variable, while you try to read “traindocuid” (pay attention to the u)
All seems well with the actual code.
The sanity check only replaces "uid:uid" with "dc:title" everything else is the same.