1. IdentityLink与TaskEntity
An identity link is used to associate a task with a certain identity. For example: - a user can be an assignee (= identity link type) for a task - a group can be a candidate-group (= identity link type) for a task
TaskEntity包含了一系列的IdentityLink操作方法:
public IdentityLinkEntity addIdentityLink(String userId, String groupId, String type) {
IdentityLinkEntity identityLinkEntity = new IdentityLinkEntity();
getIdentityLinks().add(identityLinkEntity);
identityLinkEntity.setTask(this);
identityLinkEntity.setUserId(userId);
identityLinkEntity.setGroupId(groupId);
identityLinkEntity.setType(type);
identityLinkEntity.insert();
if (userId != null && processInstanceId != null) {
getProcessInstance().involveUser(userId, IdentityLinkType.PARTICIPANT);
}
return identityLinkEntity;
}
注意,IdentityLink有一个Type,有一些默认的Type:

本文浅析Activiti的工作流引擎中,IdentityLink与TaskEntity的关系。IdentityLink用于将任务与特定身份关联,如任务的指派者或候选人。TaskEntity包含对IdentityLink的操作。同时探讨了IdentityLink在权限过滤中的作用,例如查询用户kermit的待办任务列表的实现过程。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



