【发布时间】:2019-09-21 03:31:24
【问题描述】:
我想根据数组中有多少项来分支 AWS 状态机的流程。如果数组有 0 个项目,我想结束流程。如果它有超过 0 个项目,我想做一些事情。
例如,我想做如下的事情:
{
"StartAt": "IsBig",
"States": {
"IsBig": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.things.length",
"NumericGreaterThan": 0,
"Next": "Big"
}
],
"Default": "Small"
},
"Big": {
"Type": "Pass",
"Result": "1",
"End": true
},
"Small": {
"Type": "Pass",
"Result": "0",
"End": true
}
}
}
然后我会在执行时传递以下内容:
{ "things": [1, 2, 3] }
我希望IsBig 然后调用Big 并结束。
有没有办法在 AWS 状态语言中做到这一点?
如果我不能,我将创建一个获取数组长度的 Lambda。我只是好奇。
【问题讨论】:
标签: amazon-web-services aws-step-functions