Package org.uengine.persistence.processdefinition

Examples of org.uengine.persistence.processdefinition.ProcessDefinitionRepositoryHomeLocal


 
  public void renameProcessDefinition(String pdid, String newName) throws RemoteException{
    log("renameProcessDefinition", new Object[]{pdid, newName});
    try{
      ProcessTransactionContext tc = getTransactionContext();
      ProcessDefinitionRepositoryHomeLocal pdhr = GlobalContext.createProcessDefinitionRepositoryHomeLocal(tc);     
      ProcessDefinitionRepositoryLocal pdr = pdhr.findByPrimaryKey(new Long(pdid));
      pdr.setName(newName);
     
      //2011.1.11 add by yookjy
      //rename upd
      String pdvid = String.valueOf(pdr.getProdVerId());
View Full Code Here


  public ProcessDefinitionRemote getProcessDefinitionRemote(String pdvid) throws RemoteException{
    try{
      ProcessDefinitionVersionRepositoryHomeLocal pdvrhl = GlobalContext.createProcessDefinitionVersionRepositoryHomeLocal(getTransactionContext());
      ProcessDefinitionVersionRepositoryLocal pdvrl = pdvrhl.findByPrimaryKey(new Long(pdvid));
     
      ProcessDefinitionRepositoryHomeLocal pdhr = GlobalContext.createProcessDefinitionRepositoryHomeLocal(getTransactionContext());
      ProcessDefinitionRepositoryLocal pdl = pdhr.findByPrimaryKey(pdvrl.getDefId());
      int productionVersion = pdl.getProdVer();
     
      ProcessDefinitionRemote pdr =null;
     
      try{
View Full Code Here

    }
  }
 
  public ProcessDefinitionRemote getProcessDefinitionRemoteByDefinitionId(String defId) throws RemoteException{
    try{
      ProcessDefinitionRepositoryHomeLocal pdhr = GlobalContext.createProcessDefinitionRepositoryHomeLocal(getTransactionContext());
      ProcessDefinitionRepositoryLocal pdrl = pdhr.findByPrimaryKey(new Long(defId));
      ProcessDefinitionRemote pdr = new ProcessDefinitionRemote(pdrl, null);

      return pdr;

    }catch(Exception e){
View Full Code Here

  public void removeFolder(String folderId) throws RemoteException{
    log("removeFolder", new Object[]{folderId});

    try{
      //Check there is child
      ProcessDefinitionRepositoryHomeLocal pdhr = GlobalContext.createProcessDefinitionRepositoryHomeLocal(getTransactionContext());
      //if there is child of this folder, this folder can't be removed
      Collection childs = pdhr.findByFolder(new Long(folderId));
      if(childs.iterator().hasNext())
        throw new UEngineException("This folder is not empty");
         
      ProcessDefinitionRepositoryLocal pdr = pdhr.findByPrimaryKey(new Long(folderId));

      pdr.setIsDeleted(true);
    }catch(Exception e){
      e.printStackTrace();
      throw new RemoteException("ProcessManagerError:"+e.getMessage(), e);
View Full Code Here

     
      Collection versions = pdvh.findAllVersions(pdid);
      //force to remove the definition if there's no more version.
      if(!versions.iterator().hasNext()) throw new ObjectNotFoundException();
    }catch(javax.ejb.ObjectNotFoundException e){
      ProcessDefinitionRepositoryHomeLocal pdhr = GlobalContext.createProcessDefinitionRepositoryHomeLocal(tc);   
      ProcessDefinitionRepositoryLocal pdr = pdhr.findByPrimaryKey(pdid);
     
      //don't remove
      //pdr.remove();     
      pdr.setIsDeleted(true);
    }
View Full Code Here

    return addDefinitionImpl(belongingPdid, pdvid, version, name, description, isAdhoc, definition, folder, overwrite, null);
  }
 
  public String[] addDefinitionImpl(String belongingPdid, String pdvid, int version, String name, String description, boolean isAdhoc, Object definition, String folder, boolean overwrite, Map options) throws Exception{
   
    ProcessDefinitionRepositoryHomeLocal pdhr = GlobalContext.createProcessDefinitionRepositoryHomeLocal(tc);
    boolean verifyModifiedDateWhenOverwriting = true;
 
    boolean isOtherResourceType = options!=null && options.containsKey("objectType");
    String objectType = "upd";
    if(isOtherResourceType)
      objectType = (String)options.get("objectType");

    //if there is no parent folder, this will throw an exception to break this try~catch block
    if(UEngineUtil.isNotEmpty(folder) && !folder.equals("-1")){   
      try{
        pdhr.findByPrimaryKey(new Long(folder));
      }catch(javax.ejb.ObjectNotFoundException e){
        throw new UEngineException("No such folder");
      }
    }else{
      folder="-1";
    }

    //if there is no definition for this version, create new one
    boolean definitionExist = false;   
    if(belongingPdid !=null){
      try{
        pdhr.findByPrimaryKey(new Long(belongingPdid));
        definitionExist = true;
      }catch(Exception e){
      }
    }   
    if(!definitionExist){
      belongingPdid = ""+UniqueKeyGenerator.issueProcessDefinitionKey(tc);
      ProcessDefinitionRepositoryLocal pdr = pdhr.create(new Long(belongingPdid));
      pdr.setName(name);
      pdr.setParentFolder(new Long(folder));
      if(UEngineUtil.isNotEmpty(description))
        pdr.setDescription(description);
     
      if(options!=null && options.containsKey("objectType")){
        objectType = (String)options.get("objectType");     
        pdr.setObjType(objectType);
      }
      if(options!=null && options.containsKey("alias")){
        String alias = (String)options.get("alias");     
        pdr.setAlias(alias);
        ProcessDefinitionRepositoryLocal  pdrl=null;
        try{
          pdrl = pdhr.findByAlias(alias);
        }catch(Exception e){
        }
        if(pdrl != null)
          throw new UEngineException("This alias("+alias+") already exists, Write another keyword!");
      }
View Full Code Here

TOP

Related Classes of org.uengine.persistence.processdefinition.ProcessDefinitionRepositoryHomeLocal

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.