Package org.uengine.persistence.processdefinition

Examples of org.uengine.persistence.processdefinition.ProcessDefinitionDAO


public class DefaultDeployFilter implements DeployFilter {

  public void beforeDeploy(ProcessDefinition definition, ProcessTransactionContext tc, String folder, boolean isNew) throws Exception {
   
    ProcessDefinitionDAO procDef = (ProcessDefinitionDAO) tc.findSynchronizedDAO("bpm_procdef", "defid", definition.getBelongingDefinitionId(), ProcessDefinitionDAO.class);
   
    if (isNew) {
      RevisionInfo ri = (RevisionInfo) definition.getRevisionInfoList().get(0);
      AclManager acl = AclManager.getInstance();
     
      acl.setPermission(
          Integer.parseInt(definition.getBelongingDefinitionId()),
          AclManager.ACL_FIELD_EMP, ri.getAuthorId(),
          new String[]{AclManager.PERMISSION_MANAGEMENT + ""}
      );
     
      if (UEngineUtil.isNotEmpty(ri.getAuthorCompany())) {
        acl.setPermission(
            Integer.parseInt(definition.getBelongingDefinitionId()),
            AclManager.ACL_FIELD_COM, ri.getAuthorCompany(),
            new String[]{AclManager.PERMISSION_INITIATE + "", AclManager.PERMISSION_VIEW + ""}
        );
        procDef.setComCode(ri.getAuthorCompany());
      }
    } else {
      procDef.setName(definition.getName().getText());
      procDef.setDescription(definition.getDescription().getText());
    }
   
  }
View Full Code Here

TOP

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

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.