一、仅做了解
//用户组的处理
public class TestUserGroup {
private ProcessEngine processEngine=ProcessEngines.getDefaultProcessEngine();
//创建用户和用户组
@Test
public void createUserAndGroup() {
IdentityService identityService = this.processEngine.getIdentityService();
//保存到act_id_group
GroupEntity group = new GroupEntity("1");
group.setName("部门经理");
identityService.saveGroup(group);
GroupEntity group2 = new GroupEntity("2");
group2.setName("总经理");
identityService.saveGroup(group2);
//保存到act_id_user
UserEntity user1 = new UserEntity("1");
user1.setFirstName("小明");
user1.setEmail("11111@aa.com");
identityService.saveUser(user1);
UserEntity user2 = new UserEntity("2");
user2.setFirstName("小张");
identityService.saveUser(user2);
UserEntity user3 = new UserEntity("3");
user3.setFirstName("小王");
identityService.saveUser(user3);
//建立用户和用户组的关系act_id_membership
identityService.createMembership("1", "1");
identityService.createMembership("2", "1");
identityService.createMembership("3", "2");
System.out.println("保存完成");
}
二、总结
来源:https://www.cnblogs.com/Guorisy/p/12099294.html