【问题标题】:How to Abort Informatica workflow if source file has only header row如果源文件只有标题行,如何中止 Informatica 工作流
【发布时间】:2021-09-22 09:39:50
【问题描述】:

我有一个要求,我正在检查 CSV 格式的源文件是否只有标题行,即只有 1 行,然后我需要使 informatica 工作流程失败。 Informatica 安装在 Windows 服务器中,因此仅支持命令任务,不支持 Unix 或 bash。 我正在使用以下代码在工作流中使用命令任务来计算源文件中的行数。

for /f "usebackq" %%b in (type $$outputfile ^| find "" /v /c)do ( 回显行数为 %%b> $$count_file.txt ) )

这里的 $$outfile 和 $$count_file 路径和文件名是从参数文件中挑选出来的。

【问题讨论】:

    标签: command-line command informatica


    【解决方案1】:

    您可以在表达式转换中使用ABORT()函数。
    创建一个虚拟列并在源限定符之后放置一个分类器,aggregator。在聚合器中,获取所有数据的计数,然后将其加入主流。在Jointer之后,请使用以下条件进行表达式转换 -

    IIF( cnt_all > 1, NULL, ABORT( 'Only header exists in the input file! Session will be aborted.'))
    

    整个映射应该如下所示 -

    SQ -- EXP(add dummy_col) -->SRT on dummy_col -->AGG on dummy_col, calculate Count(*)->| 
                                           |--------------------------------------------> JNR on dummy_col -->EXP (abort if count <=1) --> existing mapping logic...
    

    编辑: 从命令任务中,您可以调用pmcmd abortworkflow当您的条件满足时。正常语法以下 -

    pmcmd abortworkflow -service  service  -user username -password  password  -f  folder workflow
    

    【讨论】:

    • @koushik roy。我正在通过命令任务查看相同的任务。 span>
    猜你喜欢
    • 2016-02-11
    • 1970-01-01
    • 2019-12-29
    • 1970-01-01
    • 1970-01-01
    • 2020-11-30
    • 1970-01-01
    • 1970-01-01
    • 2021-12-14
    相关资源
    最近更新 更多