Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.19 KB | None | 0 0
  1. public List<String> getProcessSubjectLoginsWithoutTask(String snID_Process_Activiti, String sFilterLoginRole) throws RecordInmemoryException, org.json.simple.parser.ParseException {
  2.         LOG.info("getProcessSubjectLoginsWithoutTask started...").send();
  3.         LOG.info("snID_Process_Activiti {}", snID_Process_Activiti).send();
  4.         LOG.info("sFilterLoginRole {}", sFilterLoginRole).send();
  5.  
  6.        /* String sKeyMongo = (String) oRuntimeService.getVariable(snID_Process_Activiti, "sID_File_StorateTemp");
  7.         byte[] aByteTaskBody = oBytesDataStaticStorage.getData(sKeyMongo);
  8.  
  9.         JSONParser parser = new JSONParser();
  10.  
  11.         List<String> aResultLogins = new ArrayList<>();
  12.  
  13.         if (aByteTaskBody != null) {
  14.             JSONArray aJsonProcessSubject
  15.                     = (JSONArray) ((JSONObject) parser.parse(new String(aByteTaskBody))).get("aProcessSubject");
  16.  
  17.             LOG.info("aJsonProcessSubject in getProcessSubjectLoginsWithoutTask: {}",
  18.                     aJsonProcessSubject.toJSONString());
  19.  
  20.             for (Object oJsonProcessSubject : aJsonProcessSubject) {
  21.                 String sLogin = (String) ((JSONObject) oJsonProcessSubject).get("sLogin");
  22.                 aResultLogins.add(sLogin);
  23.             }
  24.         }*/
  25.         Long nID_ProcessTask = (Long) oRuntimeService.getVariable(snID_Process_Activiti, PROCESS_TASK_VARIABLE);
  26.         LOG.info("nID_ProcessTask={}", nID_ProcessTask).send();
  27.         List<ProcessTaskSubject> aoProcessTaskSubject =
  28.                 oProcessTaskSubjectService.getProcessTaskSubjectsByProcessTask(nID_ProcessTask);
  29.         LOG.info("Found {} ProcessTaskSubjects for nID_ProcessTask={}", aoProcessTaskSubject.size(),
  30.                 nID_ProcessTask).send();
  31.         List<String> asResultLogin = aoProcessTaskSubject.stream()
  32.                 .filter(p -> Objects.isNull(p.getSnID_Process_Activiti()) ||
  33.                         snID_Process_Activiti.equals(p.getSnID_Process_Activiti()))
  34.                 .map(ProcessTaskSubject::getsLogin)
  35.                 .distinct()
  36.                 .sorted()
  37.                 .collect(Collectors.toList());
  38.         LOG.info("asResultLogin: {}", asResultLogin).send();
  39.         return asResultLogin;
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement