public IdentityLinkEntity addIdentityLink(String userId, String groupId) {
   IdentityLinkEntity identityLinkEntity = IdentityLinkEntity.createAndInsert();
   getIdentityLinks().add(identityLinkEntity);
   identityLinkEntity.setProcessDef(this);
   identityLinkEntity.setUserId(userId);
   identityLinkEntity.setGroupId(groupId);
   identityLinkEntity.setType(IdentityLinkType.CANDIDATE);
   return identityLinkEntity;
 }
Exemplo n.º 2
0
 private void addAuthorizationsFromIterator(
     Set<Expression> exprSet, ProcessDefinitionEntity processDefinition, ExprType exprType) {
   if (exprSet != null) {
     Iterator<Expression> iterator = exprSet.iterator();
     while (iterator.hasNext()) {
       Expression expr = (Expression) iterator.next();
       IdentityLinkEntity identityLink = new IdentityLinkEntity();
       identityLink.setProcessDef(processDefinition);
       if (exprType.equals(ExprType.USER)) {
         identityLink.setUserId(expr.toString());
       } else if (exprType.equals(ExprType.GROUP)) {
         identityLink.setGroupId(expr.toString());
       }
       identityLink.setType(IdentityLinkType.CANDIDATE);
       identityLink.insert();
     }
   }
 }