Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Create one folder for each retrieved attachment

  1. #1

    Default Create one folder for each retrieved attachment

    Hi!

    I´m trying to arrange a Job in order to retrieve some attachments from different email addresses (saving message content & attachment). The point is that didn´t find the way to store the content from different emails in different folders: everything is stored in the same one, didn´t find the option of create the target directory dinamically, or incrementally.
    I would like to know your suggestions for fix this situation.

    Thanks in advance!

    Name:  Job.jpg
Views: 71
Size:  5.2 KBName:  transformation.jpg
Views: 67
Size:  5.1 KB

  2. #2
    Join Date
    May 2016
    Posts
    282

    Default

    You can specify a path in the filename field, and you can use metadata injection, calculate the filename as a field and check the option to accept it from field, or use a variable in the filename. Whatever it suits you.
    Regards
    OS: Ubuntu 16.04 64 bits
    Java: Openjdk 1.8.0_131
    Pentaho 6.1 CE

  3. #3

    Default

    Hi Ana,

    And thanks for your early response

    I fixed the Get emails from POP like this (please see attachment).

    Can you please provide me a few more details about it? I´m a beginner as a Pentaho developer...

    Thanks in advance!
    Attached Images Attached Images  

  4. #4

    Default

    Quote Originally Posted by Ana GH View Post
    You can specify a path in the filename field
    In which step/part concretely?

    Quote Originally Posted by Ana GH View Post
    and you can use metadata injection, calculate the filename as a field and check the option to accept it from field, or use a variable in the filename. Whatever it suits you.
    Where and how exactly? Is it correct my schema?

    Thanks in advance!

  5. #5
    Join Date
    May 2016
    Posts
    282

    Default

    I was talking about the textfile output step, but email step also accepts some or all (I haven't checked) of these methods. You can check the samples folder of your data-integration installation for examples on how to use different steps or perform common operations. I would also recommend going through the Pentaho Data Integration Beginner's Guide by María Carina, it's written for an older version, but covers the basics that haven't changed, so it was a great help when I was learning this tool.
    OS: Ubuntu 16.04 64 bits
    Java: Openjdk 1.8.0_131
    Pentaho 6.1 CE

  6. #6

    Default

    Quote Originally Posted by Ana GH View Post
    I was talking about the textfile output step, but email step also accepts some or all (I haven't checked) of these methods. You can check the samples folder of your data-integration installation for examples on how to use different steps or perform common operations. I would also recommend going through the Pentaho Data Integration Beginner's Guide by María Carina, it's written for an older version, but covers the basics that haven't changed, so it was a great help when I was learning this tool.

    The point is that I´m trying to create different folders for every new attachment arrived to an INBOX in my attach_cond Job, where I can find the Get emails from POP (retrieving attachments and creating the folder whrere the attachments will be stored, at the same time), but however cannot find the ETL Metadata Injection. That´s the main problem I´m facing.

    Thanks!
    Last edited by Peptaho_BCN; 09-29-2017 at 08:14 AM.

  7. #7
    Join Date
    Nov 2013
    Posts
    382

    Default

    Get emails job step doesn't support metadata injection.

    You must use the target directory specification to specify in which folder it will be stored. Which name do you want for your directory? Depending on what?

    Edited: Internal.Step.Unique.Count is a fixed value (most probably 0 or 1, unsure) identifying how many copies of the step will run in parallel. AFAIK this is only available for Transformation steps (with Change number of copies to start option), so for jobs is useless and in your case it will not help at all.
    Last edited by DepButi; 09-29-2017 at 09:58 AM.

  8. #8
    Join Date
    May 2016
    Posts
    282

    Default

    Quote Originally Posted by Peptaho_BCN View Post
    The point is that I´m trying to create different folders for every new attachment arrived to an INBOX in my attach_cond Job, where I can find the Get emails from POP (retrieving attachments and creating the folder whrere the attachments will be stored, at the same time), but however cannot find the ETL Metadata Injection. That´s the main problem I´m facing.
    Ok, as @DepButi has pointed out, you can't use Metadata Injection with Get emails job step, so you'll have to think of another strategy. Is it possible to process one mail at a time? So you can pass the folder as a variable to the job and think of a way to assign the variable value for each email, something like the count variable that DepButi has mentioned.
    OS: Ubuntu 16.04 64 bits
    Java: Openjdk 1.8.0_131
    Pentaho 6.1 CE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.