Package com.exedosoft.wf.wfi

Examples of com.exedosoft.wf.wfi.NodeInstance


        if(instanceUid!=null){
          data.put("busiBOName", pi.getProcessTemplate().getDoBO().getName());
          data.put("instance_uid", instanceUid);
        }
      }
      NodeInstance ni = NodeInstance.getNodeInstanceByID(bi.getValue("contextNiUid"));
      if(ni!=null && ni.getNode().getPane()!=null){
        data.put("paneModel", ni.getNode().getPane());
      }
    } else if (aFm.getLinkPaneModel() != null) {
      data.put("paneModel", aFm.getLinkPaneModel());
    }
    return data;
View Full Code Here


    DOBO ptNI = DOBO.getDOBOByName("do_wfi_nodeinstance");
    if (ptNI.getCorrInstance() == null) {
      this.setEchoValue(I18n.instance().get("当前工作流上下文丢失,请重新操作!"));
      return null;
    }
    NodeInstance ni = NodeInstance.getNodeInstanceByID(ptNI
        .getCorrInstance().getUid());
    try {
      ni.returnBack();
    } catch (WFException e) {
      this.setEchoValue(e.getMessage());
      return NO_FORWARD;
    }
    return DEFAULT_FORWARD;
View Full Code Here

    }

    List<NodeInstance> nis = pi.retrieveNodeInstances();
    Map<String, NodeInstance> nodeIMap = new HashMap<String, NodeInstance>();
    for (Iterator<NodeInstance> it = nis.iterator(); it.hasNext();) {
      NodeInstance ni = it.next();
      if (nodeIMap.get(ni.getNode().getObjUid()) == null) {
        nodeIMap.put(ni.getNode().getObjUid(), ni);
      } else if (ni.getExeStatus().intValue() == NodeInstance.STATUS_FINISH) {
        nodeIMap.put(ni.getNode().getObjUid(), ni);
      }
    }

    ProcessTemplate pt = pi.getProcessTemplate();

    StringBuilder xml = new StringBuilder("<wf>  <processtemplate name='")
        .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";
View Full Code Here

    DOBO ptNI = DOBO.getDOBOByName("do_wfi_nodeinstance");
    if (ptNI.getCorrInstance() == null) {
      this.setEchoValue(I18n.instance().get("当前工作流上下文丢失,请重新操作!"));
      return null;
    }
    NodeInstance ni = NodeInstance.getNodeInstanceByID(ptNI
        .getCorrInstance().getUid());
    WFUtil.refreshWFPara(ni.getProcessInstance());

    try {
      this.service.invokeUpdate();
    } catch (ExedoException e1) {
      this.setEchoValue(e1.getMessage());
      return NO_FORWARD;
    }
 
    try {
      ni.returnBack();
    } catch (WFException e) {
      this.setEchoValue(e.getMessage());
      return NO_FORWARD;
    }
    return DEFAULT_FORWARD;
View Full Code Here

    if(ptNI.getCorrInstance()==null){
     
      this.setEchoValue(I18n.instance().get("当前工作流上下文丢失,请重新操作!"));
      return null;
    }
    NodeInstance ni = NodeInstance.getNodeInstanceByID(ptNI.getCorrInstance().getUid());
    WFUtil.refreshWFPara(ni.getProcessInstance());
   
    try {
      ni.perform();
    } catch (WFException e) {
       this.setEchoValue(e.getLocalizedMessage());
       return null;
    }
    return DEFAULT_FORWARD;
View Full Code Here

  public String excute() throws ExedoException {
    // TODO Auto-generated method stub
   
    BOInstance para = DOGlobals.getInstance().getRuleContext().getInstance();
    if(para.getValue("corr_nodeinstance")!=null){
      NodeInstance ni = (NodeInstance)para.getObjectValue("corr_nodeinstance");
      ProcessInstance pi = ni.getProcessInstance();
     
      ///看提交人
      NodeInstance preConflict = ni.getNodeInstanceByPTNodeID(pi.getObjUid(), "tt2_n16", "" + NodeInstance.STATUS_FINISH);
     
      if(preConflict!=null){
        NodeInstance.storePersionAuth(ni.getObjUid(), preConflict.getPerformer());
      }
     
    }
   
   
View Full Code Here

      }
    } else {
      ProcessInstance pi = null;
      try {
        pi = wfi.loadProcessInstance(wfUid);
        NodeInstance ni = pi.getFirstActivityNode();
        ni.perform();
      } catch (WFException e) {
        e.printStackTrace();
        this.setEchoValue(e.getLocalizedMessage());
        return NO_FORWARD;
      }
View Full Code Here

    if (ptNI.getCorrInstance() == null) {
     
      this.setEchoValue(I18n.instance().get("当前工作流上下文丢失,请重新操作!"));
      return NO_FORWARD;
    }
    NodeInstance ni = NodeInstance.getNodeInstanceByID(ptNI
        .getCorrInstance().getUid());
    WFUtil.refreshWFPara(ni.getProcessInstance());
    try {
      this.service.invokeUpdate();
    } catch (ExedoException e1) {
      this.setEchoValue(e1.getMessage());
      return NO_FORWARD;
    }

    try {
      ni.backToStart();
    } catch (WFException e) {
      this.setEchoValue(e.getMessage());
      return NO_FORWARD;
    }
    return DEFAULT_FORWARD;
View Full Code Here

    DOBO ptNI = DOBO.getDOBOByName("do_wfi_nodeinstance");
    if(ptNI.getCorrInstance()==null){
      this.setEchoValue(I18n.instance().get("当前工作流上下文丢失,请重新操作!"));
      return null;
    }
    NodeInstance ni = NodeInstance.getNodeInstanceByID(ptNI.getCorrInstance().getUid());
    WFUtil.refreshWFPara(ni.getProcessInstance());
    try {
      this.service.invokeUpdate();
    } catch (ExedoException e1) {
      e1.printStackTrace();
      this.setEchoValue(e1.getLocalizedMessage());
      return NO_FORWARD;
    }

    try {
      ni.perform();
    } catch (WFException e) {
       this.setEchoValue(e.getLocalizedMessage());
       return NO_FORWARD;
    }
    return DEFAULT_FORWARD;
View Full Code Here

    DOBO ptNI = DOBO.getDOBOByName("do_wfi_nodeinstance");
    if (ptNI.getCorrInstance() == null) {
      this.setEchoValue(I18n.instance().get("当前工作流上下文丢失,请重新操作!"));
      return null;
    }
    NodeInstance ni = NodeInstance.getNodeInstanceByID(ptNI
        .getCorrInstance().getUid());
    WFUtil.refreshWFPara(ni.getProcessInstance());

    try {
      this.service.invokeUpdate();
    } catch (ExedoException e1) {
      this.setEchoValue(e1.getMessage());
      return NO_FORWARD;
    }
 
    try {
      NodeInstance nn = ni.returnBack();
      nn.returnBack();
     
    } catch (WFException e) {
      this.setEchoValue(e.getMessage());
      return NO_FORWARD;
    }
View Full Code Here

TOP

Related Classes of com.exedosoft.wf.wfi.NodeInstance

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.