Package org.activiti.engine.impl.persistence.entity

Examples of org.activiti.engine.impl.persistence.entity.IdentityLinkEntity


  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();
      }
    }
  }
View Full Code Here


        } else if(persistendObject instanceof DelegateExecution) {
          event.setExecutionId(((DelegateExecution) persistendObject).getId());
          event.setProcessInstanceId(((DelegateExecution) persistendObject).getProcessInstanceId());
          event.setProcessDefinitionId(((DelegateExecution) persistendObject).getProcessDefinitionId());
        } else if(persistendObject instanceof IdentityLinkEntity) {
          IdentityLinkEntity idLink = (IdentityLinkEntity) persistendObject;
          if(idLink.getProcessDefinitionId() != null) {
            event.setProcessDefinitionId(idLink.getProcessDefId());
          } else if(idLink.getProcessInstance() != null) {
            event.setProcessDefinitionId(idLink.getProcessInstance().getProcessDefinitionId());
            event.setProcessInstanceId(idLink.getProcessInstanceId());
            event.setExecutionId(idLink.getProcessInstanceId());
          } else if(idLink.getTask() != null) {
            event.setProcessDefinitionId(idLink.getTask().getProcessDefinitionId());
            event.setProcessInstanceId(idLink.getTask().getProcessInstanceId());
            event.setExecutionId(idLink.getTask().getExecutionId());
          }
        } else if(persistendObject instanceof Task) {
          event.setProcessInstanceId(((Task)persistendObject).getProcessInstanceId());
          event.setExecutionId(((Task)persistendObject).getExecutionId());
          event.setProcessDefinitionId(((Task)persistendObject).getProcessDefinitionId());
View Full Code Here

    //
    // Note: we cant move this code to the TaskEntity (which would be cleaner),
    // since the task.delete cascased to all associated identityLinks
    // and of course this leads to exception while trying to delete a non-existing identityLink
    if (task.getAssignee() != null) {
      IdentityLinkEntity identityLink = new IdentityLinkEntity();
      identityLink.setUserId(task.getAssignee());
      identityLink.setType(IdentityLinkType.ASSIGNEE);
      identityLink.setTaskId(task.getId());
      identityLinks.add(identityLink);
    }
    if (task.getOwner() != null) {
      IdentityLinkEntity identityLink = new IdentityLinkEntity();
      identityLink.setUserId(task.getOwner());
      identityLink.setTaskId(task.getId());
      identityLink.setType(IdentityLinkType.OWNER);
      identityLinks.add(identityLink);
    }
   
    return (List) task.getIdentityLinks();
  }
View Full Code Here

    //
    // Note: we cant move this code to the TaskEntity (which would be cleaner),
    // since the task.delete cascased to all associated identityLinks
    // and of course this leads to exception while trying to delete a non-existing identityLink
    if (task.getAssignee() != null) {
      IdentityLinkEntity identityLink = new IdentityLinkEntity();
      identityLink.setUserId(task.getAssignee());
      identityLink.setType(IdentityLinkType.ASSIGNEE);
      identityLinks.add(identityLink);
    }
    if (task.getOwner() != null) {
      IdentityLinkEntity identityLink = new IdentityLinkEntity();
      identityLink.setUserId(task.getOwner());
      identityLink.setType(IdentityLinkType.OWNER);
      identityLinks.add(identityLink);
    }
   
    return (List) task.getIdentityLinks();
  }
View Full Code Here

    CommandContext commandContext = Context.getCommandContext();
    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);
        commandContext.getDbSqlSession().insert(identityLink);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.persistence.entity.IdentityLinkEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.