Sep 25 2008
Get the filename of a document that is the input for a LiveCycle process
Disease:
Your process takes a Document type as input parameter and you need to know its file name somewhere in your process.
Prescription:
In LiveCycle you can use XPath to write expressions to get access to document attributes and write those values into a process variable. The expression to get the filename would be:
getDocAttribute(/process_data/@doc_input, “basename”)
Tips to stay healthy:
The getDocAttribute function is documented on LiveDocs but it does not list all the string names for document attributes that you can retrieve (read on….). There is also a page on Document attributes for attachments and notes.
A really cool way to find out what attributes are available to you, is to use a new feature of LiveCycle Workbench named Record and Playback. This way you just Record a running process which takes a document as input parameter. Then during playback you can introspect that document variable and then Workbench will list all attribute variables available! When I did this in my processes I noticed that the available attributes depends on the document you submit (and it might explain why they are not documented) to just name a few; ‘Length’, ‘ContentType’, ‘Wsfilename’, ‘Basename’ and ‘file’.
[updated on 25th] Added the tip to use Workbench Record and Reply to find document attributes.