//用戶組的處理ide
public class TestUserGroup {this
private ProcessEngine processEngine=ProcessEngines.getDefaultProcessEngine();blog
//建立用戶和用戶組ip
@Testget
public void createUserAndGroup() {it
IdentityService identityService = this.processEngine.getIdentityService();class
//保存到act_id_groupim
GroupEntity group = new GroupEntity("1");d3
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("保存完成");
}