/** * @return Set that contains the Process names available */ @SuppressWarnings("unchecked") public static TreeSet getProcessName(String baseUrl, String uname, String pwd){ int pendingCount=0; String psName=""; TreeSet pndngLst = new TreeSet (); JSONParser parser = new JSONParser(); try{ URL jsonWF = new URL(baseUrl+ "wflow-wfweb/web/json/workflow/assignment/history" + "?j_username="+uname+"&j_password="+pwd); URLConnection jsonData = jsonWF.openConnection(); BufferedReader in = new BufferedReader( new InputStreamReader( jsonData.getInputStream())); String inputLine="",psList=""; /*Get the pending assignment list JSON object*/ while ((inputLine = in.readLine()) != null) { psList+=inputLine; } output.write("\nList of processes : "+psList); Object obj=parser.parse(psList); JSONObject jsonObj=(JSONObject)obj; /*get the total no of process history available*/ String total=jsonObj.get("total").toString(); pendingCount=Integer.parseInt(total); if(pendingCount == 1){ String data=jsonObj.get("data").toString(); /*Parse the data part to get the process name in list JSON Object*/ obj=parser.parse(data); jsonObj=(JSONObject)obj; psName=jsonObj.get("processName").toString(); pndngLst.add(psName); } else if(pendingCount > 1){ String data=jsonObj.get("data").toString(); /*Parse the data part to get the process name in list JSON Object*/ obj=parser.parse(data); JSONArray array=(JSONArray)obj; ArrayList dataList=new ArrayList(); for(int i=0;i