When you use the "Send With Map of Attachments", the map you provide need to be a map of "document" and not string.
Each document element in the map contains the content of the file you want to attach and the corresponding key contains the name of that attachment.
Does that make more sense?
As Jasmin says, if you're passing a Map variable explicitly, the key contains the name of the file as it will be displayed to the end user, and the map value contains a Document. Note that it MUST be a document, not the path to a document. If your file lives on the file system, you'll have to use the File utilities to read it into a document.
Your xpath (using SetValue) to set the map will look something like this (from memory, I may get something wrong)...
/process_data/mymap[@id="File1.pdf"] = /process_data/@document1
/process_data/mymap[@id="File2.pdf"] = /process_data/@document2
(etc, as needed)
However, if you use a literal, rather than a map variable, things get much easier. There is an "interpretation" column that allows you to directly refer to a file on the file system, among several others. The user interface should hopefully make this obvious.
I hope this helps...
PS Actually, SendWithMap actually handles several types of map value in addition to Document. It will also handle Strings, XML Documents, and binary variables.
So the following are all valid:
/process_data/mymap[@id="File1.xml"] = /process_data/myxmlvar
/process_data/mymap[@id="File2.txt"] = "Hello world"
/process_data/mymap[@id="File3.jpg"] = /process_data/@mybinaryvar
In the case of a String, it will send the string itself. It will NOT interpret the String as a filepath.
How do I extract multiple documents from DB, does the Query Multiple rows return objects of type documents?
Thanks for your help, Howard! Additionally, Im querying a DB that can provide up to 10 attachment locations/file (e.g., T:/Files/XXXX_File.pdf) that need to be brought into a single e-mail. If I map this information to a map variable of type string, you stated In the case of a String, it will send the string itself. It will NOT interpret the String as a filepath.. How would I be able to point/upload (reiteratively) to get the file(s) into the map to work with SendWithMap?
Again, I really appreciate your help on this!
I think you should use Read Document operation from Foundation->FileUtitilies and read the file content into the map.
A very simple way to achieve this is to use a component called CollectionUtils which will do that in one operation: readMultipleDocumentsToMap.
You can find the docs here: http://avoka.dnsalias.com/confluence/display/Public/Collection+Utilities+DSC
You can download here: http://www.avoka.com/apps/checkcookie?location=/apps/qpacdownload&qpac=y&qpac_code=avokaE SComponents
FINALLY figured this out! I configured a map variable of sub-type document called "attachment_map". I have the files that are to be attached stored in a database, and I used the component Query for Multiple Rows to get the attachment data into an XML document. I then built an iterative process loop to parse the XML (using the NodeSet functions count() and position() to control this) loading the file name for each file (the map key) into the process variable "attachment_file_name" and the full file path and name into another variable "attachment_file_full_path". The process loads the documents (one at a time) into the map variable using the Foundation file utility Read Document - the input variable is /process_data/@attachment_file_full_path and the output variable is /process_data/attachment_map/[@id=/process_data/@attachment_file_name]. After the map is loaded with all the attachments I wanted, I used the Send With Map of Attachments component with /process_data/attachment_map/ as my Attachments variable. As long as the file names are unique, they all came through.
I want to do something very similar to this. I have my file attachements stored in a list(attachmentList), and I want to create a process that iterate through the list and populate the map(documentMaps).
The statement that I have in location (in Mappings) is "/process_data/documentMaps[concat("Doc",/process_data/@currentDoc)] and the statement in expression is "/process_data/attachmentList['/process_data/@currentDoc']".
I do get the error message "Invalid location: /process_data/documentMaps[Doc1] cannot be stored for action instance: 2326
Could someone tell me how can I correct this?
I think you need extra quotes around the discriminator in your xpath expression.
Can't remember for sure, don't have a running system right now to test.
I'm facing the same problem.. Did you find any solution for that??
Am facing a problem in ES2. The attachments in the workspace are been recieved on the List variable provided in the ES2 Workbench. But when u consider "Send With Map of Attachments" email service - only Map variables can be specified.
How to overcome this situation ..?Should we convert List to Map ..? if yes can u pls provide me how to do this ....
Help me on this issue ..
You would probably have to convert the list into a map variable.
Jasmin, how do you convert a list into a map?
I am using map<document> to receive multiple attachments, which is working fine with the one attachment but when i tried with multiple attachment its only receive one attachment (last attachment from all the attachments) in my workflow process, how can i receive all the attachment in my workflow.