AnsweredAssumed Answered

Group Membership cannot be created with identity service

Question asked by srón on Dec 3, 2014
Latest reply on Dec 4, 2014 by martin.grofcik
I want to bring about tasks belonging to a group with members (with identityservice.createMembership("admin", "XXX");)



    for (Task task : tasks) {

      if( identityservice.createGroupQuery().groupName("GROUP_XXX").count()==0){
      identityservice.newGroup("GROUP_1_PRODUKTAPPLIKATEUR");
    }

      if(!identityservice.createGroupQuery().list().contains(identityservice.createGroupQuery().groupId("GROUP_1_PRODUKTAPPLIKATEUR")
                 .groupMember("admin"))){
            identityservice.createMembership("admin", "XXX");
      }

      taskService.claim(task.getId(), "GROUPXXX");
}


…but I always get an error stack:


Caused by: org.apache.ibatis.exceptions.PersistenceException:

. . .

### The error may involve org.activiti.engine.impl.persistence.entity.MembershipRelation.insertMembership-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_ID_MEMBERSHIP (USER_ID_, GROUP_ID_)     values (       ?,       ?     )



Integrity constriant violated, superordinate key not found. The group is not there in the database. I do not know what the reason of this error might be, does anyone have an idea?

Outcomes