flowable 通过流程id 查询该流程下的组成员
时间: 2023-10-05 13:13:45 浏览: 43
您可以使用 Flowable 的 API 来查询特定流程定义的候选组成员。具体的方法如下:
```java
List<IdentityLink> identityLinks = processEngine.getIdentityService().getIdentityLinksForProcessDefinition(processDefinitionId);
```
其中,`processDefinitionId` 是您要查询的流程定义的 ID。该方法将返回一个 `IdentityLink` 对象的列表,每个对象表示一个流程候选用户或组。您可以使用 `getType()` 方法来确定每个 `IdentityLink` 是用户还是组,使用 `getUserId()` 或 `getGroupId()` 方法来获取用户或组的 ID。
例如,以下代码将列出指定流程定义的所有候选组:
```java
List<IdentityLink> identityLinks = processEngine.getIdentityService().getIdentityLinksForProcessDefinition(processDefinitionId);
for (IdentityLink identityLink : identityLinks) {
if ("candidate".equals(identityLink.getType()) && identityLink.getGroupId() != null) {
System.out.println("Group id: " + identityLink.getGroupId());
}
}
```
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)