一、僅做瞭解 //用戶組的處理 public class TestUserGroup { private ProcessEngine processEngine=ProcessEngines.getDefaultProcessEngine(); //創建用戶和用戶組 @Test public voi ...
一、僅做瞭解
//用戶組的處理
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("[email protected]");
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("保存完成");
}
}二、總結