You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Peoplesoft technical

1 reply [Last post]
Guest's picture
Guest

Hi all

I have a situation where One application engine programm is dependent on another app engine programme.
programe 2 is scheduled after first one. I need to do something that if in any situation if first programme get failed then second one should not be run.

Second programme should be run post first one got success.

If any one can provide some idea that how I can do the same

raj.psoft's picture
User offline. Last seen 1 year 39 weeks ago. Offline
Joined: 03/25/2010
Posts: 26
Re: Peoplesoft technical

Write a code to show the status of the process if it get sucess trigger the second one if it went to nosucess stop the process to trigger the second one.

The below code can useful to get the process sucess or not.
If &MYRQST.Status = 0 Then /* if Schedule status is success */

&LOOP = 0;
While &LOOP = 0
SQLExec("SELECT A.DISTSTATUS, A.RUNSTATUSDESCR FROM PS_PMN_PRCSLIST A WHERE A.PRCSNAME = :1 AND A.PRCSINSTANCE = (SELECT MAX(B.PRCSINSTANCE) FROM PS_PMN_PRCSLIST B WHERE B.PRCSNAME = A.PRCSNAME)", &MyAppName, &POSTED, &STATUS);

If &STATUS = "Success" And
&POSTED = 5 Then /* Posted */
&LOOP = 1
End-If;

If &STATUS = "Success" And /* Not Posted */
&POSTED = 4 Then
&LOOP = 2
End-If;

If &STATUS = "No Success" Or
&STATUS = "Error" Then
&LOOP = 3;
End-If;

End-While;

If &LOOP = 1 Then
MessageBox(0, "", 00000, 594, ""); /* Success Msg */
Else
If &LOOP = 2 Or
&LOOP = 3 Then
MessageBox(0, "", 00000, 595, ""); /* Failed Error Msg */
End-If;
End-If; /* If &LOOP = 1 Then */
End-If; /* If &MYRQST.Status = 0 Then */

once this code is completed call the second appengine.

Raj