简体   繁体   English

错误记录邮件的要求(邮件应包含所有丢失的文件详细信息)。 在 ADF 流程中

[英]Requiremet of Error logging mail(mail should contain all the missing file details). in the ADF flow

the reqirement is simple, i have a folder having 4 txt files(1.txt,2.txt,3.txt,4.txt).要求很简单,我有一个包含 4 个 txt 文件(1.txt、2.txt、3.txt、4.txt)的文件夹。 the Flow is controlled by a parameter called all or some which is of string type. Flow 由一个名为all 或 some的字符串类型的参数控制。 这是 adf 管道,其中包含活动

If i select all in the parameter, all 4 file should be processed.如果 i select 全部在参数中,则应处理所有 4 个文件。 the requirement starts here >>要求从这里开始 >>

  1. IF any file is missing from the folder(for ex 2.txt and 3.txt is not present and i selected ALL in the parameter), i need a mail saying file is 2.txt and 3.txt is missing.如果文件夹中缺少任何文件(例如2.txt 和 3.txt不存在并且我在参数中选择了ALL ),我需要一封邮件说文件是 2.txt 和 3.txt 丢失。

  2. If i select some in the parameter, for ex 1.txt and 4.txt and if any of the file is missing 1.txt and 4.txt is missing(for example 1.txt is missing), i need a mail with the missing file name(ie 1.txt in our case).如果我 select 参数中的一些,例如1.txt 和 4.txt并且如果任何文件丢失 1.txt 和 4.txt 丢失(例如 1.txt 丢失),我需要一封邮件缺少文件名(即我们的例子中的 1.txt)。

capture missing file details in one variable在一个变量中捕获丢失的文件详细信息

I tried to repro this capturing missing files using azure data factory.我尝试使用 azure 数据工厂重现捕获丢失文件的过程。 Below is the approach.下面是方法。

  • Take a parameter of array type in the pipeline.在管道中取一个数组类型的参数。 During runtime, you can give the list of file names in a folder to be processed in this array parameter.在运行时,您可以在此数组参数中给出要处理的文件夹中的文件名列表。在此处输入图像描述

  • Take a get metadata activity and add a dataset in the activity.获取元数据活动并在活动中添加数据集。 Click +New in the field list and select child items as an argument.单击字段列表中的+New和 select子项作为参数。

在此处输入图像描述

  • Take a filter activity and give the array parameter value in items and write the condition to filter the missing files in condition box做一个filter activity,在items中给数组参数值,在condition box中写条件过滤缺失的文件

item: @pipeline().parameters.AllorSome项目: @pipeline().parameters.AllorSome

condition: @not(contains(string(activity('Get Metadata1').output.childItems),item()))条件: @not(contains(string(activity('Get Metadata1').output.childItems),item()))

  • I tried to run this pipeline.我试图运行这条管道。 During run time, four file names are given to the array parameter.在运行时,四个文件名被赋予数组参数。在此处输入图像描述

  • Get Metadata activity output has three file names.获取元数据活动 output 具有三个文件名。

在此处输入图像描述

  • Parameter has 4 filenames and Get meta data activity has 3 filenames.参数有 4 个文件名,获取元数据活动有 3 个文件名。 Missing file names are to be filtered out.丢失的文件名将被过滤掉。
  • Output of filter activity: Output 过滤活动:

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM