Ejemplo n.º 1
0
  /**
   * 完成业务记录 id:业务表id assignee:开始流程后的处理人 processKey:流程key busiDesc:该流程描述信息 model:业务表类名
   *
   * @return
   * @throws Exception
   */
  public String complete_process_pre() throws Exception {
    String assignee = getpara("assignee");
    String processKey = getpara("processKey");
    String busiDesc = getpara("busiDesc");
    ProcessModel pm = null;

    // processkey
    // hello_single_Demo

    String moelStr[] = processKey.split("_");
    if (moelStr.length >= 2) {
      pm =
          (ProcessModel)
              Class.forName("com.app.manager.model." + moelStr[moelStr.length - 1]).newInstance();
      rhs.put("model", moelStr[moelStr.length - 1]);
      baseDao.create(pm);
      rhs.put("formId", pm.getId());
    } else {
      rhs.put("model", "");
      rhs.put("formId", "");
    }
    rhs.put("assignee", assignee);
    rhs.put("processKey", processKey);
    rhs.put("busiDesc", busiDesc);

    return "success";
  }
Ejemplo n.º 2
0
  /** 开启流程前,先新建一个业务记录 , */
  public String start_process_pre() throws Exception {
    log.debug("start_process()");
    String id = "";
    String assignee = getpara("assignee");
    String processKey = getpara("processKey");
    String busiDesc = "";
    ProcessModel pm = null;
    Map<String, Object> map = new HashMap<String, Object>();
    String moelStr[] = processKey.split("_");
    map.put("model", "");
    // 如果流程有表关联,新建记录
    if (moelStr.length >= 2) {
      pm =
          (ProcessModel)
              Class.forName("com.app.manager.model." + moelStr[moelStr.length - 1]).newInstance();
      baseDao.create(pm);
      map.put("model", moelStr[moelStr.length - 1]);
      id = pm.getId().toString();
    }
    map.put("startUserName", getpara(getCurrentAccount()));

    String pid =
        infActiviti.startProcessAssigneeVar(processKey, id, getCurrentAccount(), assignee, map);
    Task task = taskService.createTaskQuery().processInstanceId(pid).singleResult();
    String taskid = task.getId();
    String taskUrl = formService.getTaskFormData(taskid).getFormKey();

    // 如果有表关联
    if (moelStr.length >= 2) {
      pm.setProcessInstanceId(pid);
      baseDao.update(pm);
    }

    rhs.put("taskId", taskid);
    rhs.put("taskUrl", taskUrl);
    return "success";
  }
Ejemplo n.º 3
0
  /**
   * 开启流程,传入的request必须有以下参数: id:业务表id assignee:开始流程后的处理人 processKey:流程key busiDesc:该流程描述信息
   * model:业务表类名
   *
   * @return
   * @throws Exception
   */
  public String start_process() throws Exception {
    log.debug("start_process()");
    String id = getpara("id");
    String assignee = getpara("assignee");
    String processKey = getpara("processKey");
    String busiDesc = getpara("busiDesc");
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("model", getpara("model"));
    map.put("startUserName", getpara(getCurrentAccount()));
    String pid =
        infActiviti.startProcessAssigneeVar(processKey, id, getCurrentAccount(), assignee, map);
    Task task = taskService.createTaskQuery().processInstanceId(pid).singleResult();
    String taskid = task.getId();
    String taskUrl = formService.getTaskFormData(taskid).getFormKey();

    if (id != null && !"".equals(id)) {
      ProcessModel pm = (ProcessModel) baseDao.loadById(getpara("model"), Long.parseLong(id));
      pm.setProcessInstanceId(pid);
      baseDao.update(pm);
    }
    rhs.put("taskId", taskid);
    rhs.put("taskUrl", taskUrl);
    return "success";
  }