0 Replies Latest reply on Mar 28, 2017 2:16 PM by Abdulrahman2

    how to Wait for Completion of concurrent program request given in Java


      Hi Intelligentsia,


      how do i check whether the concurrent program is completed in java code.



      my original  requirement to validate data in a table with business rules,


      and show another master detail page


      since the validation is resource intensive, we have made a concurrent program and we initiate the concurrent program just before showing the master detail page.


      i need to somehow refresh the Detail region VO , after checking the concurrent program is successfully completed.


      we have got the request id successfully.


      i do not want to delay calling the next page,


      instead i want to refresh the called page  View after the concurrent program has successfully closed the program


      one solution could be to show the Submit Request Region in my custom page.


      how do i change or incorporate code to refresh my Detail Page VO

              try {
                  OAApplicationModule oaapplicationmodule = pageContext.getRootApplicationModule(); 
              OADBTransaction tx =  oaapplicationmodule.getOADBTransaction();
      //        Hashtable hash;
      //        OADBTransaction tx = (OADBTransaction)hash.get("oaDbTransaction");
              java.sql.Connection pConnection =  tx.getJdbcConnection();
              ConcurrentRequest cr = new ConcurrentRequest(pConnection);
              String applnName ="TGCUST";  //Application that contains the program
              String cpName ="XXTG_VALIDATE_CONTRACT_BATCH";
              String cpDesc ="XXTG Validate Contract Batch"; //Description 
              Vector cpArgs =new Vector();
             // Calling the Concurrent program
             int requestID = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs);
                  System.out.println("Request ID of Validation Program : "+requestID);
      //       return requestID;
               catch(RequestSubmissionException e) 
                      OAException oe = new OAException(e.getMessage());
                          OAApplicationModule oaapplicationmodule = pageContext.getRootApplicationModule(); 
                          throw oe;




      Thanks in anticipation of your solution