PeopleSoft – Application Engine SQL Actions unveiled

Hi Folks… PeopleSoft is back again.

If you are unble to get how to use DoWhen, DoWhile, DoSelect and DoUntil actions or unable to understand them, then you are at the right place.

This post is for dummies who don’t know how to use these actions or what are these actions for.

So to use any of the actions you need to use %Select().

For E.g. to use DoWhen, a SQL must be written for this action.

%Select(<Field from AET record>)

Now this will give you the correct result you need to perform. This statement will return one row of data and the Step will perform its other actions.

So now we will discuss these actions in detail.

  1. DoWhen: This action is the first one to be invoked in the step. It determines if the remaining of the actions in the step is needed to be run or not. This is kind of an IF statement you use in basic coding languages. So if the SQL written in this action returns at least one row of data then the remaining actions of the step is run else they will not. This action is execute only once while entering the step.
  2. DoWhile: This action is the next one in the list. And it is just like a while loop. This action will determine how many times the actions below in the step will be executed. This will execute the below actions if the SQL returns at least one row of data. And will again check the condition till it gives zero rows exactly like a while loop. This actions will execute till it returns zero rows.
  3. DoSelect: This action is executed after the DoWhile action. This is like java [for(String arg : args)] loop. This will execute the below actions i.e. SQL, PeopleCode, Call Section and Log Message for each returned row individually. This action is executed just after DoWhile action, so if the DoWhile action returns zero rows then this action is not executed.
  4. DoUntil: This action is last in the execution list. This is like a do-while loop in C/C++, but it stops execution when the condition is true, so you can say this is like a do-until loop. If this action returns at least one row of data then the loop will be executed. This action can be used without DoWhile action also, but it should not return any row to continuing looping.

Note: Either of DoWhile or DoUntil can terminate the loop irrespective of the other provides a positive condition to continue the loop.

So now you know that how and when these actions can be used in the Application Engine. These are true helpers in processing the data in PeopleSoft and will provide you better support in case of any failures. Instead of using the PeopleCode loops in Application Engine better proceed with these actions to fulfill your requirements, as they will provide you the support of restarting the application Engine without any data issues.

Thanks for reading and happy coding… 🙂

Leave a Reply