如何从管道B检查管道A的状态。我必须将管道A的状态传递给管道B中的If活动我已经创建了一个管道A,它有3个databricks笔记本,在管道B上,我必须使用If活动并传递管道A的状态。在False条件下,我必须重新运行管道A。是否有任何方法可以通过代码/活动检查管道的状态,以便我可以在if条件中传递它。管道B的流程如下所示:如果活动:管道A执行不成功:否则重新运行:添加等待活动
vmpqdwk31#
false
{ "name": "P_B", "properties": { "activities": [ { "name": "Set variable1", "type": "SetVariable", "dependsOn": [], "userProperties": [], "typeProperties": { "variableName": "flag", "value": { "value": "true", "type": "Expression" } } }, { "name": "Until1", "type": "Until", "dependsOn": [ { "activity": "Set variable1", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "expression": { "value": "@not(equals(variables('flag'),'false'))", "type": "Expression" }, "activities": [ { "name": "Execute Pipeline1", "type": "ExecutePipeline", "dependsOn": [], "userProperties": [], "typeProperties": { "pipeline": { "referenceName": "P_A", "type": "PipelineReference" }, "waitOnCompletion": true } }, { "name": "Set variable3", "type": "SetVariable", "dependsOn": [ { "activity": "Execute Pipeline1", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "variableName": "flag", "value": "true" } }, { "name": "Set variable4", "type": "SetVariable", "dependsOn": [ { "activity": "Execute Pipeline1", "dependencyConditions": [ "Failed" ] } ], "userProperties": [], "typeProperties": { "variableName": "flag", "value": "false" } } ], "timeout": "0.12:00:00" } }, { "name": "Wait1", "type": "Wait", "dependsOn": [ { "activity": "Until1", "dependencyConditions": [ "Succeeded" ] } ], "userProperties": [], "typeProperties": { "waitTimeInSeconds": 10 } } ], "variables": { "flag": { "type": "String" } }, "annotations": [] } }
zpqajqem2#
您可以为整个需求创建一个主管道1.创建一个变量并将默认值赋为“False”1.使用执行管道活动来执行PipelineA。将Waitoncompletion设置为True1.通过“完成时”(绿色)箭头将其连接到设置变量活动1.在设置变量活动中将状态变量设置为“True”1.通过“on completion”路径将其与If Activity连接(蓝色)1.在If活动中,检查“status”变量是否为true1.在真正的块中,通过执行管道活动调用管道B1.在false block中,使用web activity调用rest API再次运行管道A以下是REST API运行管道的链接:https://learn.microsoft.com/en-us/rest/api/datafactory/pipelines/create-run?tabs=HTTP
2条答案
按热度按时间vmpqdwk31#
false
的标志变量。false
本身。zpqajqem2#
您可以为整个需求创建一个主管道
1.创建一个变量并将默认值赋为“False”
1.使用执行管道活动来执行PipelineA。将Waitoncompletion设置为True
1.通过“完成时”(绿色)箭头将其连接到设置变量活动
1.在设置变量活动中将状态变量设置为“True”
1.通过“on completion”路径将其与If Activity连接(蓝色)
1.在If活动中,检查“status”变量是否为true
1.在真正的块中,通过执行管道活动调用管道B
1.在false block中,使用web activity调用rest API再次运行管道A
以下是REST API运行管道的链接:https://learn.microsoft.com/en-us/rest/api/datafactory/pipelines/create-run?tabs=HTTP