AWS步骤功能 - 检查Dynamo中的多个条目是否已更新

发布于 2025-02-04 19:02:24 字数 353 浏览 3 评论 0 原文

我有用于计算部门的操作成本的步骤功能。每个部门都由员工组成。员工是Dynamo中的单个记录,字段(Empid,Salary,Salary_status(处理,已待处理,NOT_ELIBLE)))

部门运营成本成本stepfunction示例:为单个部门

启动 - >步骤1:Update EmployeeSalaryLambda->步骤2:等待更新员工薪水(Dynamo) - > dofoo() - >结束

是否有一种方法可以直接从stepfunction进行发电机检查。IE检查特定部门的所有员工salary_status ==付费是否付费?

感谢您的帮助

I have stepfunction for calculating operation cost of Departments. Each department consists of Employees. Employee is individual records in dynamo with fields (EmpId, Salary, Salary_Status(Processed, Pending, Not_Eligible))

Department operation cost Stepfunction example: Runs for individual departments

Start -> Step1: updateEmployeeSalaryLambda -> step2: wait for employee salary to be updated(Dynamo) -> doFoo() -> End

Is there a way to do the dynamo check from stepfunction directly .i.e check if all employees in a particular department have Salary_Status == Paid?

Thanks for all the help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一抹微笑 2025-02-11 19:02:24

有两种方法。

引入 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 another Lambda within your Step 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文