Subscribe

By RSS
By Email

Delivered by FeedBurner

Recent Comments

    • Piyush K - Can we dynamically change the Mouse over text of a…Can we dyn
    • mutyala rao - This doesn't run on OS390 process scheduler?…This doesn
    • XML - HI, Please send the documention on XML Publisher to following email…HI, Please
    • XML - Hi, Please send any documention on XML Publisher. Thanks, Sridhara Raju…Hi, Please
    • Ketan Benegal - Have you published the second part of this blog?? Interested…Have you p

Ask the Experts – 46

By Nitin Pai on November 20th, 2008 under Ask the Expert.

Hi
Can we call Unix commands through peoplecode?

Thanks

Thanks for posting your question!

Exec is a cross-platform function that executes an external program on either UNIX or Windows.

This function has two parameter conventions in order to maintain upward compatibility with existing programs.

Note. All PeopleCode is executed on the application server. So if you’re calling an interactive application, you receive an error. There shouldn’t be any application interaction on the application server console.

The function can make either a synchronous or asynchronous call. Synchronous execution acts as a “modal” function, suspending the PeopleSoft application until the called executable completes. This is appropriate if you want to force the user (or the PeopleCode program) to wait for the function to complete its work before continuing processing. Asynchronous processing, which is the default, launches the executable and immediately returns control to the calling PeopleSoft application.

If Exec is unable to execute the external program, the PeopleCode program terminates with a fatal error. You may want to try to catch these exceptions by enclosing such statements in a try-catch statement (from the Exception Class).

Example:

&ExitCode = Exec(”touch test.txt”, %Exec_Synchronous + %FilePath_Absolute);

Please refer to PeopleBooks for further details.

Thanks

Nitin Pai

Bookmark and Share

Comments:none;



Comments are closed.