json - 选择状态不指向下一个状态 - AWS
问题描述
我有以下步进功能。执行在选择状态下失败。
"States": {
"Process": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123:function:dummy1",
"OutputPath": "$",
"Next": "ChoiceStatePre"
},
"ChoiceStatePre": {
"Type": "Choice",
"Choices": [{
"Variable": "$.status_pre",
"Next": "Series0",
"NumericEquals": 1
}, {
"Variable": "$.status_pre",
"Next": "MatchStatePre",
"NumericEquals": 8
}]
},
"MatchStatePre": {
"Type": "Task",
"Next": "PreProcess",
"Resource": "arn:aws:states:us-east-1:123:activity:dummy2"
},
"Series0": {
"Resource": "arn:aws:lambda:us-east-1:123:function:dummy3",
"Type": "Task",
"InputPath": "$.seq0.step0",
"ResultPath": "$.seq0.step0",
"OutputPath": "$",
"Next": "ChoiceStateTrigger0"
}
}
错误 -
{
"error": "States.Runtime",
"cause": "An error occurred while executing the state 'ChoiceStatePre'
(entered at the event id #7). Failed to transition out of the state. The
state does not point to a next state."
}
我已经有了它的下一个状态,但是错误表明选择状态没有指向任何下一个状态。
解决方案
在查看“ChoiceStatePre”时,我没有看到默认状态。这似乎是这次失败的根本原因。请添加默认状态并重试。像这样的东西:
"DefaultState": { "Type": "Fail", "Cause": "No Matches!" }