Blog Pro de Jean-Baptiste HEREN

Notes d'un consultant Freelance en Informatique

To content | To menu | To search

Peoplecode : Lancer un traitement et en attendre le résultat.

Voici comment en Peoplecode, il est possible d'exécuter d'autres traitements et d'attendre leur fin avant de poursuivre.

Local ProcessRequest &prcsrqst;
Local JavaObject &Obj;   
     
      &prcsrqst = CreateProcessRequest("Application Engine", "TEST");
      &prcsrqst.RunControlID = TEST_AET.RUN_CNTL_ID.Value;
      &prcsrqst.Schedule();
     
      &Obj = CreateJavaObject("java.lang.Thread");
      &Obj.start();
     
      &RunStatus = "0";
      While &RunStatus <> "9" And
            &RunStatus <> "3" And
            &RunStatus <> "1" And
            &RunStatus <> "10"
         REM Directly use the Java sleep() Method for 5 seconds;
         &Obj.sleep(5000);
         SQLExec("SELECT RUNSTATUS FROM PSPRCSRQST WHERE PRCSINSTANCE = :1", &prcsrqst.ProcessInstance, &RunStatus);
         REM MessageBox(0, "", 0, 0, "Sleep(), Runstatus = %1", &RunStatus);
      End-While;
      &Obj.stop();
     
      rem WriteLog("Process TEST is Finished");
     
      If &prcsrqst.Status = 10 /* No success */ Or
            &prcsrqst.Status = 3 /*( Error)*/ Then
         /* Process your errors */
         Exit (1);
      Else
        /* Process your success */
      End-If;

Jean-Baptiste Heren

Author: Jean-Baptiste Heren

Stay in touch with the latest news and subscribe to the RSS Feed about this category

Comments are closed


no attachment



You Might Also Like

Finding one component location in the peoplesoft portal

Just replace the 'MY_COMPONENT_GBL' parameter in the following sql script. This works for MS SQl Server. You can add more levels by adding Outer Joins. [SQL] /* Where is my component in the portal */...

Continue reading

02_-_new_component_interface.png

Peoplesoft Component interface HOWTO

Here is a tutorial explaining how you can create a function containing one Component INterface, and make use of it from any peolplecode. Following example takes the PO Receipt Component to make...

Continue reading