Package com.exedosoft.plat.bo

Examples of com.exedosoft.plat.bo.BOInstance


    log.info(srcExp);
    String expression = srcExp.trim().toLowerCase();
    PTNode tNode = this.getNode();

    // //////////////////////////相对应业务对象
    BOInstance bi = tNode.getProcessTemplate().getDoBO()
        .getInstance(this.getProcessInstance().getInstanceUid());
    // //////////来自界面输入
    BOInstance formBI = DOGlobals.getInstance().getSessoinContext()
        .getFormInstance();
    if (bi == null && formBI == null) {
      log.info("判断表达式,无法得到执行判断参考值.");
      return srcExp;
    }

    Collection boProperties = tNode.getProcessTemplate().getDoBO()
        .retrieveProperties();
    // //this.getNodeDecision 可能是一个复杂的表达式,不仅仅是一个字段 可能是多个字段的加减乘除运算
    //
    expression = StringUtil.getCalException(expression, bi, boProperties,
        "0");
    // /////////////////////流程定义的表单的值替换
    for (Iterator itVar = this.getProcessInstance().retrieveVarInstances()
        .iterator(); itVar.hasNext();) {
      VarInstance vi = (VarInstance) itVar.next();
      String value = vi.getVarValue();
      if (value == null) {
        log.info("Form====================");
        log.info(formBI);
        value = formBI.getValue(vi.getVarName());
      }
      if (value == null) {
        value = "0";
      }
      expression = expression.replaceAll(vi.getVarName(), value);
View Full Code Here


  // /////////////////////上一个节点决定下一个节点的执行,把决定对象的权限写入权限表
  private void storeNextNodeAuthorization(NodeInstance nextNodeInstance) {

    SessionContext us = DOGlobals.getInstance().getSessoinContext();
    BOInstance formI = us.getFormInstance();
    // if (nextPerformerUid == null || "".equals(nextPerformerUid.trim())) {
    // nextPerformerUid = formI.getValue("doNextPerformerUid2");
    // }
    // if (nextPerformerUid == null || "".equals(nextPerformerUid.trim())) {
    // nextPerformerUid = formI.getValue("doNextPerformerUid3");
    // }

    // /////////除了处理schedue_user 的情况,还要处理
    // schedule_dept等的情况,又跟组织结构表绑死了,可以考虑另外的方式

    // //////////////很简单 有ptNode 决定 和哪级组织结构绑定,ptnode 再增加一个字段,表示需要绑定的组织机构

    if (nextNodeInstance.getAuthType() != null
        && (nextNodeInstance.getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_USER || nextNodeInstance
            .getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_ROLE)) {
      // //通过从界面上取值,上一个节点的SpecName决定下一个节点的使用者

      String scheduleIds = "scheduleIds";
//      if (scheduleIds == null || "".equals(scheduleIds.trim())) {
//        scheduleIds = "scheduleIds";
//      }

      String nextPerformerUids = formI.getValue(scheduleIds);


      // /一般在实际审批过程中,就是制定人,如果指定角色意义不大,因为角色范围大,完全可以采用预定义的
      // //而具体的人的弹性比较大; PTNode.AUTH_TYPE_SCHEDULE_ROLE这个可以去掉
      if (nextPerformerUids != null) {

        if (nextPerformerUids.length() < 50) {
          nextNodeInstance.setScheduleOUUid(nextPerformerUids);
        }

        String[] idarray = nextPerformerUids.split(",");
        for (int i = 0; i < idarray.length; i++) {
          String anId = idarray[i];
          DOAuthorization da = new DOAuthorization();

          storePersionAuth(nextNodeInstance.getObjUid(),anId);
          // /针对 user 存储 存储权限表, 修改待办的 sql
//
//          da.setParterUid(OrgParter.getDefaultEmployee().getObjUid());
//          da.setOuUid(anId);
//          da.setWhatType(DOAuthorization.WHAT_WF_NODEINSTANCE);
//          da.setWhatUid(this.getObjUid());
//          da.setAuthority(Boolean.TRUE);
//          da.setIsInherit(Boolean.TRUE);
//          try {
//            DAOUtil.BUSI().store(da);
//          } catch (ExedoException e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//          }
        }
      }

      // WFDAO dao = new WFDAO();
      try {
        DAOUtil.BUSI().store(nextNodeInstance);
      } catch (Exception ex) {
        ex.printStackTrace();
      }
    }

    /**
     * 计划执行的人员有自定义的动作来完成,这个方法并不是由上个节点决定的
     *
     *
     *
     *
     *
     */
    if (nextNodeInstance.getAuthType() != null
        && (nextNodeInstance.getAuthType().intValue() == PTNode.AUTH_TYPE_SCHEDULE_CLASS)) {

      DOAction doa = ActionFactory.getAction(nextNodeInstance.getNode()
          .getAccessClass());
      BOInstance para = new BOInstance();
      para.putValue("corr_nodeinstance", nextNodeInstance);
      doa.setInstance(para);
      if (doa != null) {
        try {
          doa.excute();
        } catch (ExedoException e) {
View Full Code Here

        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;
View Full Code Here

   */
  String getDynaListForm(DOFormModel property) {

    List halfs = new ArrayList();
    for (Iterator it = property.getLinkService().invokeSelect().iterator(); it.hasNext();) {
      BOInstance svo = (BOInstance) it.next();
     
      String[] half = new String[2];
      half[0] = (String) svo.getUid();
      half[1] = (String) svo.getName();

      halfs.add(half);
    }
    StringBuffer buffer = new StringBuffer();
    buffer.append(formSelectStr(property, halfs));
View Full Code Here

    OrgParter userParter = OrgParter.getDefaultEmployee();

    DOBO userBO = userParter.getDoBO();

     
    BOInstance   bi = DOValueResultList.getAInstance(property,userBO, theValue);


    if (bi != null) {
      return bi.getName();
    }
   
    if (theValue == null || "null".equals(theValue)) {
      return "&nbsp;";
    }
View Full Code Here

        System.out.println(totalmgruid);
        System.out.println("-----------");
        System.out.println(template);
        System.out.println(createExlPath);
        System.out.println("+++++++++++++TOW+++++++++++++++++");
        BOInstance bi = new BOInstance();
        bi.putValue("exlfile", createExlPath);
        this.setInstance(bi);
        return this.DEFAULT_FORWARD;
       
      } else {       
        return "生成报销单Excel文件失败!2";
View Full Code Here

   */
  public static String writeZip(String paneModelUid, DOBO bo,
      DOService aService, String allSelects) throws IOException {

    String deptCode = "a000000";
    BOInstance aUser = DOGlobals.getInstance().getSessoinContext()
        .getUser();
    if (aUser != null) {
      deptCode = aUser.getValue("deptcode");
    }
    StringBuilder zipFilePath = new StringBuilder(DOGlobals.WORK_DIR)
        .append(File.separator).append(deptCode);
    File aWkDir = new File(zipFilePath.toString());
    if (!aWkDir.exists()) {
      aWkDir.mkdir();
    }

    zipFilePath.append(File.separator).append("batch.zip");

    File aFile = new File(zipFilePath.toString());
    aFile.createNewFile();
    OutputStream os = new FileOutputStream(aFile);
    ZipOutputStream zos = new ZipOutputStream(os);
    String[] arraySelect = allSelects.split(",");
    for (int i = 0; i < arraySelect.length; i++) {
      String aSelect = arraySelect[i];
      if (aSelect == null || aSelect.trim().equals("")) {
        continue;
      }
      BOInstance aInstance = bo.refreshContext(aSelect);
      if (aService != null) {
        try {
          aService.invokeAll();
        } catch (ExedoException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
      // String aFileName = aInstance.getValue("APP_NAME");
      if (aInstance != null) {
        String id_applyid = aInstance.getValue("id_applyid");
        ZipEntry ze = new ZipEntry(id_applyid + ".xml");
        zos.putNextEntry(ze);
        zos.write(DODownLoadFile.outHtmlCode(paneModelUid).getBytes(
            "utf-8"));
        ze.clone();
View Full Code Here

        doBO = property.getLinkBO();
      } else if (property.getLinkService() != null) {
        doBO = property.getLinkService().getBo();
      }

      BOInstance bi = DOValueResultList.getAInstance(property, doBO,
          property.getValue());

      System.out.println("BOInstance===========" + bi);

      if (bi != null) {
        buffer.append(" value=\"").append(bi.getName()).append("\"");
      }

    }

    buffer.append(" readonly=\"readonly\" ");
View Full Code Here

      } else {
        String[] strs = theValue.split(";");
        StringBuffer buffer = new StringBuffer();
        for (int i = 0; i < strs.length; i++) {
          String aInsUid = strs[i];
          BOInstance bi = corrBO.getInstance(aInsUid);
          if (bi != null) {
            DOPaneModel theModel = fm.getLinkPaneModel();
            if (theModel != null
                && theModel.getLinkType() != null
                && (theModel.getLinkType().intValue() == DOPaneModel.LINKTYPE_TREEMODEL)) {
View Full Code Here

    return theValue;
  }

  public static BOInstance getAInstance(DOFormModel property, DOBO corrBO,
      String theValue) {
    BOInstance bi = null;
    if (property != null) {
      DOService linkService = property.getLinkService();

      if (linkService != null && linkService.hasOnePara()) {
        List list = linkService.invokeSelect(theValue);
View Full Code Here

TOP

Related Classes of com.exedosoft.plat.bo.BOInstance

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.