如何在部署前从流程中获取候选组?

How to get candidate group from process before deployment?

我想在部署之前从流程中获取候选组或候选用户。如何在部署前访问流程定义变量和任务?

我可以访问这个变量吗?可能吗?

这是获取特定任务 (taskId) 的所有候选人的方法。

List<String> users = new ArrayList<String>();
List<String> groups = new ArrayList<String>();
List<IdentityLink> links = taskService.getIdentityLinksForTask(taskId);
for (IdentityLink link : links) {
    if (IdentityLinkType.CANDIDATE.equals(link.getType())) {
        String userId = link.getUserId();
        if (userId != null) {
            users.add(userId);
        }
        String groupId = link.getGroupId();
        if (groupId != null) {
            groups.add(groupId);
        }
    }
}