Expand my Community achievements bar.

Document attributes for attachments

Avatar

Former Community Member
On page 66 in the Livecycle 7.2 Creating Workflows documentation, there is a section titled, "Document attributes for attachments." In this section, there are attributes listed that are available to return information on task attachment files.



I've tried various permutations of my XPath expression to extract these attributes with no luck.



Has anyone tried this or can someone from Adobe comment on what the correct syntax is?



For reference, the attributes I'm looking at are:

wsfilename

wspermission

wscreatorid

wsdescription



I have placed my attachments into a list (document) variable.



Thank you,

Michael
7 Replies

Avatar

Level 9
Hi Michael

These attributes aren't available via xpath expressions.

What do you need them for?

If it's important to you, you could get at them via a custom QPAC.

We'd be happy to talk to you about that if you're interested.

Howard

http://www.avoka.com

Avatar

Former Community Member
]These attributes aren't available via xpath expressions.



According to page 67 of the Livecycle 7.2 Creating Workflows documentation, "
To set attachment attributes, you use XPath expressions."

By extension, one would think these attributes can be read by XPath expressions as well.



At the end of my workflow, I'd like to email the main workflow PDF as well as any task attachments. I'm trying to retrieve the file names of the attachments to be used as file names in the Email with Attachments QPAC.



I know the task attachments are there because I can attach them to the email if I hard code a file name.



Thank you.

Avatar

Level 9
Hi Michael

Let me rephrase :-)


As far as I'm aware, these attributes aren't available via xpath expressions (either to set or get them). If you, or anyone else on this forum work out how to do this, I'd be very interested in knowing how.

Michael, what is the xpath expression you're using to attach the files to the Email QPAC?

Howard

http://www.avoka.com

Avatar

Former Community Member
Hi Everyone

You can set and get attributes for documents via XPath. Here are a few examples.



In a Setvalue qpac, you can use the following syntax to set the permission of the document in position 1 of your list called "doclist", to read/write/delete:



Left side of setValue:

/process_data/doclist[1]



Right side of setvalue:

setDocAttribute(/process_data/doclist[1],"wspermission", "7")



-------------------------------------------------------------------



To set a document name in position 2 of the list to file.txt:



Left side of setValue:

/process_data/@doclist[2]



Right side of setValue:

setDocAttribute(/process_data/doclist[2],"wsfilename", "file.txt")



---------------------------------------------------------------------



To retrieve that file name, create a variable of type string called

docfilename to hold it.



Left side of setValue:

/process_data/@docfilename



Right side of setValue:

getDocAttribute(/process_data/doclist[2],"wsfilename")



Hope this helps.



Diana@adobe

Avatar

Former Community Member
Diana,



Thank you SO much! This is exactly what I was looking for and works perfectly! I wasn't aware of getDocAttribute.



And just a note for future readers, the list variable is not a 0 based index. So if you have two documents in a list (document) variable, they are accessed as:

/process_data/doclist[1]

/process_data/doclist[2]



Thanks again!

Avatar

Former Community Member
Hi Michael

Yes you are correct. This is a bit of a gotcha. XPath is 1 based...so the first entry in the list would be at [1] not [0].



However, is you are accessing the same list via the Script qpac, the first entry in your list will be at [0].



This is because java is 0 based but Xpath is 1 based.



Diana@adobe

Avatar

Level 9
Thanks Diana

Michael, I apologise for my misleading email previously.

Regards,

Howard