Interface AssigneeResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Resolves an assignee declaration into a concrete list of user IDs.
把声明式参与者(user / role / dept / expr)解析成实际 userId 列表。
The engine consults this SPI whenever a step is about to materialise its
tasks, dispatching on Assignee.type(). Implementations should throw
if resolution returns nothing meaningful; an empty list is treated as error
BASE-FLOW-RES-001 by the engine.
引擎在节点创建任务时调用本 SPI,根据 Assignee.type() 分派。
实现方在解析无意义时应直接抛异常;返回空列表会被引擎统一视为
BASE-FLOW-RES-001 错误。
- Since:
- JDK 25, opencode-base-flow V1.0.5
- Author:
- Leon Soo
-
Method Summary
Modifier and TypeMethodDescriptionresolve(Assignee assignee, FlowContext ctx) Resolves the givenAssigneedeclaration into the concrete user IDs that should receive the task.default booleanvalidateUser(String userId, FlowContext ctx) Validates that auserIdrefers to a real, active user able to receive tasks.
-
Method Details
-
resolve
Resolves the givenAssigneedeclaration into the concrete user IDs that should receive the task. 把给定Assignee解析成实际接收任务的 userId 列表。- Parameters:
assignee- the declarative assignee record from the DSL — DSL 中的声明式参与者ctx- the current flow context — 当前流程上下文- Returns:
- non-null list of user IDs (empty list is treated as error
BASE-FLOW-RES-001) — 非 null userId 列表(空列表视为错误) - Since:
- JDK 25, opencode-base-flow V1.0.5
-
validateUser
Validates that auserIdrefers to a real, active user able to receive tasks. Default returnstrue(no validation; the host is responsible). Implementations are encouraged to provide a real check in multi-tenant / off-boarded-user scenarios. 校验给定userId是否为系统中可承接任务的有效用户。 默认true(不做校验,由宿主自行保证 transfer 安全)。 实现方建议在多租户 / 离职用户场景下提供真实判定。- Parameters:
userId- candidate user id — 待校验 userIdctx- the current flow context — 当前流程上下文- Returns:
truewhen the user is valid for task delivery — 用户可接收任务时返回true- Since:
- JDK 25, opencode-base-flow V1.0.5
-