plakosizzle
plakosizzle

Reputation: 1

Setting a variable in Penatho DI that changes if a file is processed

I am working on a Pentaho job that takes processes and deletes files from an email account and then places the data in a database. The job then loops back to check if there are additional files.

The problem is that if no files are found in the first iteration, there is a mail step that sends an email explaining what happened. If there is a single file at all, the job is not supposed to send the email and it is supposed to end.

I added a 'wait for file' step followed by 'file exists' step at the end to check if it should end the job or loop back, but my boss said it would be better to set a variable, 'emailProcessed' to 'false', then change it before the loop.

I have tried different stuff but I don't think I am doing it right, the job is failing on the set variables transformation.

I have looked for similar questions but none were exactly what I needed. Any tips would be appreciated

Upvotes: 0

Views: 25

Answers (1)

plakosizzle
plakosizzle

Reputation: 1

Got it, I simply put the set_variables transformation in the end AFTER the file gets processed then, on the next iteration, if there is no file, I checked if the variable exists using simple evaluation, if it exists, no email is sent. Thanks

Upvotes: 0

Related Questions