Ejemplo n.º 1
0
 public List<String> getDepartMentLeaderFormBpm(
     String groupPath, String groupName, int level, boolean onlyFirst) throws Exception {
   JSONObject params = new JSONObject();
   params.put("groupPath", groupPath);
   params.put("groupName", groupName);
   params.put("level", level);
   params.put("onlyFirst", onlyFirst);
   String result =
       HttpHelper.doBpmRequest(
           webServiceConfigInfo.getBpmDepartMentLeader(),
           params,
           HttpHelper.RestType.post,
           new String[] {
             webServiceConfigInfo.getBpmAdminUsername(), webServiceConfigInfo.getBpmAdminPassword()
           });
   System.out.println(result);
   List<String> list =
       HttpHelper.getMapper()
           .readValue(result, HttpHelper.getCollectionType(ArrayList.class, String.class));
   return list;
 }
Ejemplo n.º 2
0
 /**
  * @throws Exception
  *     <p>getBpmInfoByBpmPrimary 根据bpm模型id获取流程的所有信息 @param bpmId @return @return String @exception
  */
 public String saveAndGetBpmInfoByBpmPrimary(String processDefinitionId) throws Exception {
   String result = "";
   // 根据流程主键数据库获取流程信息
   BpmFlowInfo bpmFlowInfo = bpmConfigDaoImpl.getBpmFlowInfoByBpmId(processDefinitionId);
   if (bpmFlowInfo != null) {
     result = bpmFlowInfo.getText();
   } else {
     NodeDefinition procDef = bpmService.queryProcessDefinition(processDefinitionId);
     if (procDef != null && !"".equals(procDef)) {
       // 插入数据库
       bpmFlowInfo = new BpmFlowInfo();
       bpmFlowInfo.setId(UUID.randomUUID().toString());
       bpmFlowInfo.setBpmid(processDefinitionId);
       bpmFlowInfo.setBpmkey(processDefinitionId.substring(0, processDefinitionId.indexOf(":")));
       bpmFlowInfo.setText(HttpHelper.getMapper().writeValueAsString(procDef));
       result = bpmFlowInfo.getText();
       bpmConfigDaoImpl.insertIntoBpmFlowInfo(bpmFlowInfo);
     }
   }
   return result;
 }