AWS步骤功能 - 检查Dynamo中的多个条目是否已更新
我有用于计算部门的操作成本
的步骤功能。每个部门都由员工组成。员工是Dynamo中的单个记录,字段(Empid,Salary,Salary_status(处理,已待处理,NOT_ELIBLE)))
部门运营成本成本stepfunction示例:为单个部门
启动 - >步骤1:Update EmployeeSalaryLambda->步骤2:等待更新员工薪水(Dynamo) - > dofoo() - >结束
是否有一种方法可以直接从stepfunction进行发电机检查。IE检查特定部门的所有员工salary_status ==付费是否付费?
感谢您的帮助
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两种方法。
引入 sort key 。应用程序的可能分类密钥设计可能是:
[部门]#[salary_status]
。您可以在步骤函数
中从另一个lambda
中查询它。如果您知道该部门中有多少员工,则可以计算数字与已找到的付费员工的计数相匹配。另一个选择是检查有多少员工没有付费状态(请参阅这个)。如果您需要更复杂的查询,也可以利用。
There are two ways of doing it.
Introduce a sort key. Possible sort key design for your application may be:
[Department]#[Salary_Status]
. You can query it from anotherLambda
within yourStep Function
. If you know how many employees are in the department, you can count if the number matches the count of found paid employees. Another option is to check how many employees don't have Paid status (refer to this).If you need more complex query you can also leverage secondary index.