How do we get the next task Id of a User Input Task. This has to be entered in t

How do we get the next task Id of a User Input Task. This has to be entered in the Send Email Smart Service which is triggered before the User Input Task? Is there any such Out Of The Box function?...

OriginalPostID-114894

OriginalPostID-114894

  Discussion posts and replies are publicly visible

Parents
  • This piece of code is giving me an empty array?
    Long[] currentTasksIdsForProcessArray = new Long[100];
                        TaskSummary[] taskResults = new TaskSummary[100];

                        ProcessExecutionService processExecutionService = ServiceLocator.getProcessExecutionService(sc);
                        try {
                        
                                  ResultPage resultPage;
                        
                                  resultPage = processExecutionService.getCurrentTasksForProcess(processID, com.appiancorp.suiteapi.process.ProcessExecutionService.UNATTENDED_AND_ATTENDED_TASKS, 1, 10, TaskSummary.SORT_BY_ID, Constants.SORT_ORDER_ASCENDING);
                                  
                                  taskResults = (TaskSummary[])resultPage.getResults();
                                  List<Long> currentTasksIdsForProcessList = new ArrayList<Long>();
                                  for (TaskSummary taskSummary : taskResults)
                                  {
                                            currentTasksIdsForProcessList.add(taskSummary.getId());
                                  }
                                  System.out.println("Task IDs Array is -->"+currentTasksIdsForProcessList);
                                  currentTasksIdsForProcessArray = currentTasksIdsForProcessList.toArray(new Long[100]);
                                  System.out.println("Task IDs are -->"+currentTasksIdsForProcessArray);
                                  
                        } catch (InvalidProcessException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                        } catch (PrivilegeException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                        }
                        
                        
                        
                        return currentTasksIdsForProcessArray;
Reply
  • This piece of code is giving me an empty array?
    Long[] currentTasksIdsForProcessArray = new Long[100];
                        TaskSummary[] taskResults = new TaskSummary[100];

                        ProcessExecutionService processExecutionService = ServiceLocator.getProcessExecutionService(sc);
                        try {
                        
                                  ResultPage resultPage;
                        
                                  resultPage = processExecutionService.getCurrentTasksForProcess(processID, com.appiancorp.suiteapi.process.ProcessExecutionService.UNATTENDED_AND_ATTENDED_TASKS, 1, 10, TaskSummary.SORT_BY_ID, Constants.SORT_ORDER_ASCENDING);
                                  
                                  taskResults = (TaskSummary[])resultPage.getResults();
                                  List<Long> currentTasksIdsForProcessList = new ArrayList<Long>();
                                  for (TaskSummary taskSummary : taskResults)
                                  {
                                            currentTasksIdsForProcessList.add(taskSummary.getId());
                                  }
                                  System.out.println("Task IDs Array is -->"+currentTasksIdsForProcessList);
                                  currentTasksIdsForProcessArray = currentTasksIdsForProcessList.toArray(new Long[100]);
                                  System.out.println("Task IDs are -->"+currentTasksIdsForProcessArray);
                                  
                        } catch (InvalidProcessException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                        } catch (PrivilegeException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                        }
                        
                        
                        
                        return currentTasksIdsForProcessArray;
Children
No Data