在这里输入图像描述我有一个场景,我必须检查两个条件,如果这两个条件都是真的话,那么在ADF中执行一组活动。
我尝试了if条件内的if条件活动,但是ADF不允许它。
所以基本上我的设计是两个查找来读取数据,如果条件检查条件1,如果是这样,那么再次进入内部两个查找来读取数据,如果条件检查条件2,但是它不起作用。
还有其他工作要做吗?
我试过,并在条件内条件活动,但它是不工作的。请建议一下。
发布于 2022-09-21 12:46:47
因为我们不能在IF活动中使用if,所以我们可以通过包含IF、and或etc函数的表达式来利用IF活动中的多个条件。
下面的JSON管道在某种程度上就是一个例子:
{
"name": "pipeline7",
"properties": {
"activities": [
{
"name": "If Condition1",
"type": "IfCondition",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"expression": {
"value": "@and(greater(pipeline().parameters.Test2, pipeline().parameters.Test1),greater(pipeline().parameters.Test4, pipeline().parameters.Test3))",
"type": "Expression"
},
"ifFalseActivities": [
{
"name": "Wait2",
"type": "Wait",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": 1
}
}
],
"ifTrueActivities": [
{
"name": "Wait1",
"type": "Wait",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"waitTimeInSeconds": 1
}
}
]
}
}
],
"parameters": {
"Test1": {
"type": "int",
"defaultValue": 1
},
"Test2": {
"type": "int",
"defaultValue": 2
},
"Test3": {
"type": "int",
"defaultValue": 3
},
"Test4": {
"type": "int",
"defaultValue": 4
}
},
"annotations": []
}
}您的方法是正确的,以防您不想创建另一个管道,并在if活动中使用execute活动进行另一个比较。
https://stackoverflow.com/questions/73800224
复制相似问题