Examples of PTNode


Examples of com.exedosoft.wf.pt.PTNode

      return DOAuthorization.isAccess(
          Integer.valueOf(DOAuthorization.WHAT_WF_NODEINSTANCE),
          this.getObjUid(), null, null);
    }

    PTNode tNode = this.getNode();
    if (tNode == null) {
      return true;
    }
    String accessClass = tNode.getAccessClass();

    // ///////////// PTNode.AUTH_TYPE_JAVA的情况
    if (this.getAuthType() != null
        && this.getAuthType().intValue() == PTNode.AUTH_TYPE_JAVA) {
      if (accessClass != null && !"".equals(accessClass.trim())) {
        WFAccess wfa = null;
        try {

          Class caClass = Class.forName(accessClass);
          wfa = (WFAccess) caClass.newInstance();
          return wfa.isAccess(this);

        } catch (ClassNotFoundException ex) {
          log.error(ex.getMessage());
          return false;
        } catch (Exception ex1) {
          log.error(ex1);
          return false;
        }

      }
    }

    // //////////////////PTNode.AUTH_TYPE_SCHEDULE_USER/ROLE的情况
    if (this.getAuthType() != null
        && (this.getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_USER || this
            .getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_ROLE)) {
      SessionContext context = DOGlobals.getInstance()
          .getSessoinContext();
      String accessOrg = this.getScheduleOUUid();
      if (accessOrg != null) {

        if (this.getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_USER) {
          String contextUserUid = context.getUser().getUid();
          if (accessOrg.equals(contextUserUid)) {
            return true;
          } else {
            return false;
          }
        } else {
          List<OrgParterValue> parters = (List<OrgParterValue>) DOGlobals
              .getInstance().getSessoinContext().getUser()
              .getObjectValue(LoginMain.ALLAUTH);
          for (Iterator<OrgParterValue> it = parters.iterator(); it
              .hasNext();) {
            OrgParterValue pv = it.next();
            if (pv.getName().equals(accessOrg)) {
              return true;
            }
          }
          return false;
        }
      }
    }

    // ////////////////PTNode.AUTH_TYPE_AUTHTABLE的情况 和其他SpecName 约定
    if (tNode != null) {

      // ////////通过specName 确定权限,比如表单的拥有者等。可以通过表单字段确定表单的拥有者
      if (this.getAuthType() != null
          && this.getAuthType().intValue() == PTNode.AUTH_TYPE_DATA_OWNER
          && tNode.getSpecName() != null) {

        SessionContext context = DOGlobals.getInstance()
            .getSessoinContext();
        String contextUserUid = null;
        if (context.getUser() != null) {
          contextUserUid = context.getUser().getUid();
        }
        String accessUser = null;

        if (tNode.getSpecName().equals("creator")) {// /流程创建者
          accessUser = this.getProcessInstance().getCreator();
        } else {
          BOInstance bi = tNode
              .getProcessTemplate()
              .getDoBO()
              .getInstance(
                  this.getProcessInstance().getInstanceUid());
          accessUser = bi.getValue(tNode.getSpecName());

        }
        if (accessUser != null) {
          if (accessUser.equals(contextUserUid)) {
            return true;
          } else {
            return false;
          }
        }
      } else {

        return tNode.isAccess();
      }
    }
    return true;

    // if (this.getNodeType() != null
View Full Code Here

Examples of com.exedosoft.wf.pt.PTNode

        .append(pt.getPtName()).append("'>");
    StringBuilder strNodeList = new StringBuilder("<nodes>");
    StringBuilder strFlowList = new StringBuilder("<transitions>");

    for (Iterator<PTNode> it = pt.retrieveNodes().iterator(); it.hasNext();) {
      PTNode aNode = it.next();
      String autoServiceName = "";
      String deciType = "";
      String authType = "";
      if (aNode.getAutoExcutesService() != null) {
        autoServiceName = aNode.getAutoExcutesService().getName();
      }
      if (aNode.getDecisionType() != null) {
        deciType = aNode.getDecisionType().toString();
      }
      if (aNode.getAuthType() != null) {
        authType = aNode.getAuthType().toString();
      }
      String paneName = "";
      if (aNode.getPane() != null) {
        paneName = aNode.getPane().getName();
      }

      String nodeName = aNode.getNodeName();
      NodeInstance nodeI = nodeIMap.get(aNode.getObjUid());
      if (nodeI != null && nodeI.getPerformer() != null) {
        String name = null;
        try {
          BOInstance user = OrgParter.getDefaultEmployee().getDoBO()
              .getInstance(nodeI.getPerformer());
          if (user != null) {
            name = user.getName();
          }
        } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
        if (name != null) {
          nodeName = nodeName + "(操作人:" + name + ")";
        }
      }
      //当流程是下一步执行人可选时,当前节点操作人若为上一步操作人所选择的,
      //则在当前节点显示当前节点的操作人.--by stone
      else if (nodeI != null && nodeI.getPerformer() == null) {
        String name = null;
        String nodeUUid = null;
        String nextUserId = null;

        nodeUUid = nodeI.getObjUid();

        if (nodeUUid != null) {
          List nextUserList = DOAuthorization.getAuthConfigOfWhat(""
              + DOAuthorization.WHAT_WF_NODEINSTANCE, nodeUUid);

          if (nextUserList.size() > 0) {
            DOAuthorization nextuserDO = (DOAuthorization) nextUserList
                .iterator().next();
            if (nextuserDO != null) {
              nextUserId = nextuserDO.getOuUid();
            }

            if (nextUserId != null) {
              BOInstance ouUser = OrgParter.getDefaultEmployee()
                  .getDoBO().getInstance(nextUserId);

              if (ouUser != null) {
                name = ouUser.getName();
              }
            }
          }
        }
        if (name != null) {
          nodeName = nodeName + "(操作人:" + name + ")";
        }
      }

      String status = "init";

      if (nodeI != null && nodeI.getExeStatus() != null) {
        switch (nodeI.getExeStatus().intValue()) {
        case NodeInstance.STATUS_RUN:
          status = "run";
          break;
        case NodeInstance.STATUS_FINISH:
          status = "finish";
          break;
        }
        ;
      }

      String aNodeStr = "<node id='" + aNode.getObjUid() + "' nodeType='"
          + aNode.getNodeTypeStr() + "' nodeName='" + nodeName

          + "' nodeStateShow='"
          + getDefault(aNode.getNodeStateShow())
          + "' nodeStateShowBack='"
          + getDefault(aNode.getNodeStateShowBack())
          + "' accessClass='" + getDefault(aNode.getAccessClass())
          + "' specName='" + getDefault(aNode.getSpecName())
          + "' passTxt='" + getDefault(aNode.getPassTxt())
          + "' rejectTxt='" + getDefault(aNode.getRejectTxt())
          + "' autoService='" + autoServiceName + "' authType='"
          + authType + "' paneName='" + paneName + "' subflow='"
          + getDefault(aNode.getNodeExt1())
          + "' decisionExpression='"
          + getDefault(aNode.getDecisionExpression())
          + "' decisionType='" + deciType + "' status='" + status
          + "' nodeDesc='" + getDefault(aNode.getNodeDesc())

          + "' x='" + aNode.getX() + "' y='" + aNode.getY() + "'/>\n";

      strNodeList.append(aNodeStr);

      List postNodes = aNode.getPostNodeDepes();
      if (postNodes != null && postNodes.size() > 0) {

        for (Iterator<NodeDenpendency> itd = postNodes.iterator(); itd
            .hasNext();) {
          NodeDenpendency nd = itd.next();
View Full Code Here

Examples of com.exedosoft.wf.pt.PTNode

    StringBuilder strNodeList = new StringBuilder("<nodes>");
    StringBuilder strFlowList = new StringBuilder("<transitions>");

    ////鏈夋椂闂存妸+鏀规帀
    for (Iterator<PTNode> it = pt.retrieveNodes().iterator(); it.hasNext();) {
      PTNode aNode = it.next();
      String autoServiceName = "";
      String deciType = "";
      String authType = "";
      if(aNode.getAutoExcutesService()!=null){
         autoServiceName = aNode.getAutoExcutesService().getName();
      }
      if(aNode.getDecisionType()!=null){
        deciType = aNode.getDecisionType().toString();
      }
      if(aNode.getAuthType()!=null){
        authType = aNode.getAuthType().toString();
      }
      String paneName = "";
      if(aNode.getPane()!=null){
        paneName = aNode.getPane().getName();
      }
      String aNodeStr = "<node id='" + aNode.getObjUid() + "' nodeType='"
          + aNode.getNodeTypeStr() + "' nodeName='"
          + aNode.getNodeName()

          + "' nodeStateShow='" + getDefault(aNode.getNodeStateShow())
          + "' nodeStateShowBack='" + getDefault(aNode.getNodeStateShowBack())
          + "' accessClass='" + getDefault(aNode.getAccessClass())
          + "' specName='" + getDefault(aNode.getSpecName())
          + "' passTxt='" + getDefault(aNode.getPassTxt()) + "' rejectTxt='"
          + getDefault(aNode.getRejectTxt()) + "' autoService='"
          + autoServiceName + "' authType='"
          + authType + "' paneName='"
          + paneName
           + "' subflow='"
            + getDefault(aNode.getNodeExt1())
          + "' decisionExpression='"
          + getDefault(aNode.getDecisionExpression()) + "' decisionType='"
          + deciType + "' nodeDesc='"
          + getDefault(aNode.getNodeDesc())

          + "' x='" + aNode.getX() + "' y='" + aNode.getY()
          + "'/>\n";

      strNodeList.append(aNodeStr);

      List postNodes = aNode.getPostNodeDepes();
      if (postNodes != null && postNodes.size() > 0) {

        for (Iterator<NodeDenpendency> itd = postNodes.iterator(); itd
            .hasNext();) {
          NodeDenpendency nd = itd.next();
View Full Code Here

Examples of com.exedosoft.wf.pt.PTNode

   */
  public NodeInstance getFirstActivityNode() {

    List nodes = this.retrieveNodeInstances();
   
    PTNode fnode = this.getProcessTemplate().getFirstActivityNode();
    if(fnode==null){
      return null;
    }
    for (Iterator it = nodes.iterator(); it.hasNext();) {
      NodeInstance node = (NodeInstance) it.next();
     
      if (node.getExeStatus()!=NodeInstance.STATUS_FINISH && node.getNodeUid().equals(fnode.getObjUid())) {
        return node;
      }
    }
    return null;

View Full Code Here

Examples of com.exedosoft.wf.pt.PTNode

      for (int i = 0; i < nList.getLength(); i++) {
        Node node = nList.item(i);
        if (node.getNodeType() == Document.ELEMENT_NODE) {
          Element e = (Element) node;
          PTNode ptNode = new PTNode();
          List existNodes = getNodeByUid.invokeSelect(e.getAttribute("id"));
          if(existNodes!=null && existNodes.size() > 0){
            continue;
          }
         
          ptNode.setObjUid(e.getAttribute("id"));
          ptNode.setNodeName(e.getAttribute("nodeName"));
          ptNode.setAccessClass(e.getAttribute("accessClass"));
          if (e.getAttribute("authType") != null
              && !e.getAttribute("authType").trim().equals("")) {
            ptNode.setAuthType(Integer.parseInt(e
                .getAttribute("authType")));
          }
         
          String autoService = e.getAttribute("autoService");
          if(autoService!=null  && !autoService.trim().equals("")){
            DOService aService = DOService.getService(autoService);
            if(aService!=null){
              ptNode.setAutoExcutesService(aService);
            }
          }
           
          String paneName = e.getAttribute("paneName");
          if(paneName!=null  && !paneName.trim().equals("")){
            DOPaneModel aPM = DOPaneModel.getPaneModelByName(paneName);
            if(aPM!=null){
              ptNode.setPane(aPM);
            }
          }
         
          ptNode.setConditon(e.getAttribute("condition"));
          ptNode.setDecisionExpression(e
              .getAttribute("decisionExpression"));
          if(e.getAttribute("decisionType")!=null && !e.getAttribute("decisionType").trim().equals("")){
            ptNode.setDecisionType(Integer.parseInt(e.getAttribute("decisionType")));
          }
          ptNode.setNodeDesc(e.getAttribute("nodeDesc"));
          ptNode.setNodeStateShow(e.getAttribute("nodeStateShow"));
          ptNode.setNodeStateShowBack(e
              .getAttribute("nodeStateShowBack"));

          ptNode.setNodeType(e.getAttribute("nodeType"));

          ptNode.setPassTxt(e.getAttribute("passTxt"));
          ptNode.setRejectTxt(e.getAttribute("rejectTxt"));
          ptNode.setSpecName(e.getAttribute("specName"));
          ptNode.setNodeExt1(e.getAttribute("subflow"));
         
          if(e.getAttribute("x")!=null){
            ptNode.setX(Integer.parseInt(e.getAttribute("x")));
          }
         
          if(e.getAttribute("y")!=null){
            ptNode.setY(Integer.parseInt(e.getAttribute("y")));
          }
         
          System.out.println("PTNODE::::::::" + ptNode);
          DAOUtil.INSTANCE().store(ptNode, insertNodeService);

        }
      }

      nList = doc.getElementsByTagName("transition");
      for (int i = 0; i < nList.getLength(); i++) {
        Node node = nList.item(i);
        if (node.getNodeType() == Document.ELEMENT_NODE) {
          Element e = (Element) node;
          List exists = getNodeDByUid.invokeSelect(e.getAttribute("id"));
          if(exists!=null && exists.size() > 0){
            continue;
          }
          NodeDenpendency nd = new NodeDenpendency();
          nd.setObjUid(e.getAttribute("id"));
          nd.setCondition(e.getAttribute("condition"));
          nd.setShowValue(e.getAttribute("showvalue"));
          PTNode preNode = PTNode.getNodeById(e.getAttribute("from"));
          nd.setPreNode(preNode);

          PTNode postNode = PTNode.getNodeById(e.getAttribute("to"));
          nd.setPostNode(postNode);

          System.out.println("NodeDenpendency::" + nd);
          DAOUtil.INSTANCE().store(nd, insertNodeDService);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.