Package org.uengine.persistence.rolemapping

Examples of org.uengine.persistence.rolemapping.RoleMappingDAOType


    mc.printElapsedTime(this);

    setCaching(false);
   
    if(modifiedRoleMappings!=null){
      RoleMappingDAOType rmDAOFacade = RoleMappingDAOType.getInstance(ptc);

      if(modifiedRoleMappings.size() > 0)       
        rmDAOFacade.removeRoleMappings(getInstanceId(), modifiedRoleMappings.keySet().iterator());
               
      RoleMappingDAO roleMappingDAO = rmDAOFacade.createDAOForInsertRoleMappingBatch();
     
      for(Iterator iterator = modifiedRoleMappings.keySet().iterator(); iterator.hasNext();){
        String roleName = (String)iterator.next();
        RoleMapping rm = (RoleMapping)cachedRoleMappings.get(roleName);
       
View Full Code Here


      return (RoleMapping)((RoleMapping)cachedRoleMappings.get(roleName)).clone();
    }
   
    if(isCaching() && modifiedRoleMappings!=null && modifiedRoleMappings.containsKey(roleName)) return null;
   
    RoleMappingDAOType rmDAOFacade = RoleMappingDAOType.getInstance(ptc);
    RoleMappingDAO roleMappingDAO = rmDAOFacade.findByInstanceIdAndRoleName(new Long(getInstanceId()), roleName);
   
    if ( roleMappingDAO.size() < 1 ) return null;
   
    RoleMapping making;
   
    if(roleMappingDAO.size()==1){
      making = rmDAOFacade.createRoleMapping(roleMappingDAO); //(RoleMapping)GlobalContext.deserialize(roleMappingDAO.getValue(), RoleMapping.class);
    }else{
      making = RoleMapping.create();
      making.setName(roleName);
     
      int i = roleMappingDAO.size();
      do{
        //RoleMapping mapping = (RoleMapping)GlobalContext.deserialize(roleMappingDAO.getValue(), RoleMapping.class);
        RoleMapping mapping = rmDAOFacade.createRoleMapping(roleMappingDAO);
        making.replaceCurrentRoleMapping(mapping)
       
        if(making.getCursor() == 0){
          making.setDispatchingOption(mapping.getDispatchingOption());
          making.setDispatchingParameters(mapping.getDispatchingParameters());
View Full Code Here

      getProcessDefinition().firePropertyChangeEventToActivityFilters(this, "roleMapping", roleMapping);

      return;
    }   

    RoleMappingDAOType rmDAOType = RoleMappingDAOType.getInstance(ptc);
   
    int count = 0;

    if(!isBatch){
      rmDAOType.removeRoleMapping(getInstanceId(), roleName);
      roleMappingDAO = rmDAOType.createDAOForInsertRoleMappingBatch();
    }

    if(roleMapping==null){
      return; //to clear the rolemapping, simply skip inserting to database
    }

    roleMapping.beforeFirst();

    do{
      RoleMapping currMapping = roleMapping.getCurrentRoleMapping();
      if(currMapping==null)
        continue;
     
      currMapping.makeSingle();
     
      if(roleMapping.getCurrentRoleMapping().resourceName == null){
        roleMapping.fill(this);
      }
     
      boolean verifyOK = true;
      switch ( currMapping.getAssignType() ) {
      case Role.ASSIGNTYPE_USER:
        if(currMapping.getEndpoint() == null ){
          if(currMapping.size()-1 != currMapping.getCursor())
            throw new UEngineException("One of rolemapping value has null endpoint.");
         
          verifyOK = false;         
        }
        break;
      }
     
      if(verifyOK){
        rmDAOType.insertRoleMappingBatch(roleMappingDAO, new Long(getInstanceId()), new Long(getRootProcessInstanceId()), roleName, currMapping);
        count++;
      }
     
    }while(roleMapping.next());
    roleMapping.beforeFirst();
View Full Code Here


  }

  public boolean isParticipant(RoleMapping rm) throws Exception{
    RoleMappingDAOType rmDAOType = RoleMappingDAOType.getInstance(ptc);
    return rmDAOType.findByRootInstanceIdAndEndpoint(new Long(getRootProcessInstanceId()), rm.getEndpoint()).size() > 0;
  }
View Full Code Here

TOP

Related Classes of org.uengine.persistence.rolemapping.RoleMappingDAOType

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.