Skip navigation
Currently Being Moderated

Send With Map of Attachments & Map Variable

Nov 30, 2007 12:10 PM

I'm trying to send multiple attachments using "Send With Map of Attachments" Service.  I've setup a map variable (attachments_map) of sub-type string to hold the path and file name for each file (represented as <full_path>/<file_name>.pdf).<br /><br />What I'm confused about is that I don't understand the keys of the map given the following statement in the help file about this specific Email service: "The keys for the map are the attachment file names. The file names should include the file name extension if the email receiver needs to associate the file with software to open it."<br /><br />I have two questions:<br /><br />1)  What are the keys for the map needed for the "Send With Map of Attachments" service for Attachments and what is the XPath representation to send this data to the service (e.g., /process_data/attachment_map/@file[0] or /process_data/attachment_map/@file[<file_name>] or what) ?  I don't know what the required XML structure looks like.  As you can tell, I've not used a map variable before either!  :)<br /><br />2)  As in the "Send With Document" service, is there a way to define the file name saved in the e-mail that the receiver sees?<br /><br />Example:<br />Receiver sees this in e-mail:  "File.pdf"<br />But the path and file are actually this:  T:/Files/XXXX_File.pdf<br /><br />Thanks for your help in advance!
 
Replies
  • Currently Being Moderated
    Nov 30, 2007 1:18 PM   in reply to (Wade_Tuomela)
    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?

    Jasmin
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 2, 2007 3:16 AM   in reply to (Wade_Tuomela)
    Hi Wade
    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...

    Howard
    http://www.avoka.com
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 2, 2007 3:22 AM   in reply to (Wade_Tuomela)
    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.

    Howard
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 2, 2007 5:27 PM   in reply to (Wade_Tuomela)
    How do I extract multiple documents from DB, does the Query Multiple rows return objects of type documents?
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2007 4:18 PM   in reply to (Wade_Tuomela)
    Hi Wade,

    I think you should use Read Document operation from Foundation->FileUtitilies and read the file content into the map.
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 4, 2007 2:29 AM   in reply to (Wade_Tuomela)
    Hi Wade
    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+Utilit ies+DSC
    You can download here: http://www.avoka.com/apps/checkcookie?location=/apps/qpacdownload&qpa c=y&qpac_code=avokaESComponents
    Howard
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 29, 2008 1:41 PM   in reply to (Wade_Tuomela)
    Hi

    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?

    Thanks
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 30, 2008 5:31 AM   in reply to (Wade_Tuomela)
    I think you need extra quotes around the discriminator in your xpath expression.
    ie.
    /process_data/documentMaps['concat("Doc",/process_data/@currentDoc)']
    Can't remember for sure, don't have a running system right now to test.
    Howard
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 12, 2009 5:54 AM   in reply to (Ben_Abraham)

    I'm facing the same problem.. Did you find any solution for that??

     

    Nith

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2010 3:58 AM   in reply to $Nith$

    hi,

         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 ..

     

    thanx

    Balaji

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 3, 2010 5:19 AM   in reply to Balaji Gurumurthy

    You would probably have to convert the list into a map variable.

     

    Jas

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 29, 2011 11:56 AM   in reply to Jasmin Charbonneau

    Jasmin, how do you convert a list into a map?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)