我在包含两个分支的 step 函数中有一个并行任务。输入是:
{
"database": "test",
"userName": "tester",
"userID": "test123",
"adGroup": "testADGroup",
"dbGroup": "ReadGroup"
}
每个分支都返回一个 json 结果,如下所示
分支 1(我使用“OutputPath”:“$”):
{
"requestType": "GrantAccess",
"DBUser": "exists",
"ADUser": "exists"
}
分支 2(我使用“ResultPath”:“$.approvalStatus”):
{
"database": "test",
"userName": "tester",
"userID": "test123",
"adGroup": "testADGroup",
"dbGroup": "ReadGroup"
"approvalStatus": "Approved"
}
当两个分支都完成时,并行任务的输出返回:
[
{
"requestType": "GrantAccess",
"DBUser": "exists",
"ADUser": "exists"
},
{
"database": "test",
"userName": "tester",
"userID": "test123",
"adGroup": "testADGroup",
"dbGroup": "ReadGroup"
"approvalStatus": "Approved"
}
]
下一个任务是选择,
"Choices": [
{
"Variable": "$.input[1].approvalStatus",
"StringEquals": "Approved",
"Next": "ProcessRequest"
},
{
"Variable": "$.input[1].approvalStatus",
"StringEquals": "Declined",
"Next": "SendDeclineNotification"
}
]
它不断给我以下错误:
"cause": "An error occurred while executing the state 'CheckApprovalStatus' (entered at the event id #16). Invalid path '$.input[1].approvalStatus': The choice state's condition path references an invalid value."
所以这是我的问题,
1)我应该如何在选择任务中引用它来获得approvalStatus
价值?
2)无论如何我可以让并行任务以json格式而不是数组返回?
提前致谢