amazon-web-services - AWS Step 函数 - 选择状态不支持字段参数?
问题描述
我正在尝试创建一个 AWS Step 函数,但它显示了一条错误消息,就像Field Parameters is not supported
Parallel 分支内的选择状态一样。我使用了以下代码:
{
"Comment": "A Parallel Step Function",
"StartAt": "ParentStep",
"States":
{
"ParentStep":
{
"Comment": "Parallel test execution to check the Input Flow",
"Type": "Parallel",
"End": true,
"Branches":
[
{
"Comment": "Parallel Execution 1",
"StartAt": "branch1",
"States":
{
"branch1":
{
"Comment": "branch1 started",
"Parameters":
{
"testvalue1.$": "$.value1"
},
"Type": "Choice",
"Choices":
[
{
"Variable": "$.testvalue1",
"NumericEquals": 1,
"Next": "subbranch1"
},
{
"Not":
{
"Variable": "$.testvalue1",
"NumericEquals": 1
},
"Next": "subbranch2"
}
],
"Default": "subbranch2"
},
"subbranch1":
{
"Comment": "sub-branch 1",
"Type": "Pass",
"End": true
},
"subbranch2":
{
"Comment": "Ending branch 1",
"Type": "Pass",
"End": true
}
}
},
{
"Comment": "Parallel Execution 2",
"StartAt": "branch2",
"States":
{
"branch2":
{
"Comment": "starting branch 2",
"Parameters":
{
"testvalue2.$": "$.value2"
},
"Type": "Choice",
"Choices":
[
{
"Variable": "$.testvalue2",
"NumericEquals": 2,
"Next": "subbranch3"
},
{
"Not":
{
"Variable": "$.testvalue2",
"NumericEquals": 2
},
"Next": "subbranch4"
}
],
"Default": "subbranch4"
},
"subbranch3":
{
"Comment": "sub-branch 3",
"Type": "Pass",
"End": true
},
"subbranch4":
{
"Comment": "Ending Parallel Execution 2",
"Type": "Pass",
"End": true
}
}
}
]
}}}
Choice
但是,如果我用状态替换状态,则相同的代码可以工作Task
。是字段Parameters
不支持的Choice
状态吗?我浏览了 AWS Step 函数文档,但看不到任何相关信息。有人可以对此有所了解吗?
谢谢
解决方案
Parameters
不支持atChoice
状态。据此,您只能使用Choices
and Default
。此外,您可以在文档中查看支持哪些字段。顺便说一句,您可以通过以下解决方案来完成您的任务。
{
"Comment": "A Parallel Step Function",
"StartAt": "ParentStep",
"States": {
"ParentStep": {
"Comment": "Parallel test execution to check the Input Flow",
"Type": "Parallel",
"End": true,
"Branches": [
{
"Comment": "Parallel Execution 1",
"StartAt": "branch1",
"States": {
"branch1": {
"Comment": "branch1 started",
"Type": "Choice",
"Choices": [
{
"Variable": "$.testvalue1",
"NumericEquals": 1,
"Next": "subbranch1"
},
{
"Not": {
"Variable": "$.testvalue1",
"NumericEquals": 1
},
"Next": "subbranch2"
}
],
"Default": "subbranch2"
},
"subbranch1": {
"Comment": "sub-branch 1",
"Type": "Pass",
"Parameters": {
"testvalue1.$": "$.value1"
},
"End": true
},
"subbranch2": {
"Comment": "Ending branch 1",
"Type": "Pass",
"Parameters": {
"testvalue1.$": "$.value1"
},
"End": true
}
}
},
{
"Comment": "Parallel Execution 2",
"StartAt": "branch2",
"States": {
"branch2": {
"Comment": "starting branch 2",
"Type": "Choice",
"Choices": [
{
"Variable": "$.testvalue2",
"NumericEquals": 2,
"Next": "subbranch3"
},
{
"Not": {
"Variable": "$.testvalue2",
"NumericEquals": 2
},
"Next": "subbranch4"
}
],
"Default": "subbranch4"
},
"subbranch3": {
"Comment": "sub-branch 3",
"Type": "Pass",
"Parameters": {
"testvalue2.$": "$.value2"
},
"End": true
},
"subbranch4": {
"Comment": "Ending Parallel Execution 2",
"Type": "Pass",
"Parameters": {
"testvalue2.$": "$.value2"
},
"End": true
}
}
}
]
}
}
}
推荐阅读
- machine-learning - 地理坐标系中的对象投影
- r - 跨多个列匹配多个字符串并创建一个是/否 (1/0) 列
- javascript - 如何将 Html 布局加载到 vuejs 组件中?
- powershell - microsoft script center: don't have permission to upload sample when adding contribution
- html - 未对齐的图像下方有文字?CSS / HTML
- python - 从 Pandas 的 DataFrame 中的查询中选择行
- json - 存储输入字段属性 id, name, type in angular 6
- .htaccess - 在 htaccess 中 [or] 和 pipe 的行为是否相同?
- python-3.x - 如何让我的程序在 python 中使用我系统的多个核心?
- forms - 如何将 NewForm.aspx 添加到在线共享点 2013 中的我的页面中