Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Is there a way to loop or while inside a job?

  1. #1
    Join Date
    Dec 2016
    Posts
    23

    Default Is there a way to loop or while inside a job?

    Hi,

    Is there a way to loop or do a while? something like that to iterate a process

    I need to read several emails, however I'm using "Get mails (POP3/IMAP)" just reading the first email, because I need to save the attachments individually and read/save some data for each email.

    But it is doing the process just for one email and not continue to the others.

    Any idea?

    Thanks

  2. #2
    Join Date
    Nov 2013
    Posts
    382

    Default

    To loop just draw the necessary hop connections ... and you will have an eternal loop!

    Add some condition, (i.e. increment a variable and use a Simple Evaluation step, or test for some file to exist, or ...) and you will have a while loop.

    Add a Wait For step and you will have a while loop executing every X time.

  3. #3
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    You really need to adjust your thinking for working in PDI.

    Loops are displayed differently.
    You build a list of emails.
    Then for each email, you do a defined set of tasks.

    So:
    Job1
    - Start
    - Transformation1
    - - Get Mail
    - - Copy Rows to Results
    - Job2 (Run for each row)
    - - Start
    - - Transform
    - - - Get Rows from Result
    etc.

    This layout lets you run Job2 (and all of the tranformations in it) for each email found in the Get Email step of Transform1.

    NOTE: I haven't tested to verify any steps exist, just posted to show how to restructure your thinking.

  4. #4
    Join Date
    Dec 2016
    Posts
    23

    Default

    Hi guys, yes I changed all the process and use another tool for that process.
    I was using pdi in a wrong way

    Thanks

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.