appengine exer 1

Upload: ravi-kumar-chellapakula

Post on 08-Apr-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 AppEngine Exer 1

    1/17

    Page 1 of 17

    Application EngineExer c ise # 1: Th e Bas ic s - I n cr ease Am t

    In this exercise, you will create an AppEngine program that accesses an employee payrate table to increase the hourly pay rate for a specified department.

    Table name: PS_GBUT_AETRN1_TBLField name: AMTWeb navigation: Tools Training > AE Training > AE Objects > Employees

    You will need a project to contain the objects created in this exercise. This may be anew project or you may open an existing project.

    To create a new project:

    1. Click on File, New or Click on

  • 8/6/2019 AppEngine Exer 1

    2/17

  • 8/6/2019 AppEngine Exer 1

    3/17

    Page 3 of 17

    Alternately, to open a project:

    1. Click on File, Open or click on

    2. In the Open Object window, eithera. Type the entire name of the project in the Name box and click on Open,

    or

    b. Type a partial name in the Name box and press ENTER to get a list tochoose from. Then either double-click the project you want to open orclick on it once to highlight and click on Open.

    Project Workspace

    GBTR_00GBUT_TRNTECH00

    GBUT_TRNTECH00

  • 8/6/2019 AppEngine Exer 1

    4/17

    Page 4 of 17

    Now that you have a project, you are ready to create an AppEngine program.

    To create a new AppEngine program:

    1. Click on File, New or Click on(see Create New Project for where this button appears on the toolbar)

    2. Click on App Engine Program and then click OK

    GBUT_TRNTECH00

    GBUT_TRNTECH00

  • 8/6/2019 AppEngine Exer 1

    5/17

    Page 5 of 17

    3. You should now see a skeleton AppEngine program containing a MAIN sectionand one step labeled Step01 displayed in the Object workspace

    4. Open the AppEngine Program Properties window:

    a. Click on or

    b. Click on File, Object properties orc. Press ALT-ENTER on your keyboard

    5. Click on the Advanced tab and check the Disable Restart box. It isimportant to disable restart of a program while testing to prevent problems withrerunning the job. Once the program is tested, Disable Restart may beunchecked to test restart processing. Click OK to close the Program Propertieswindow.

    Object Workspace

  • 8/6/2019 AppEngine Exer 1

    6/17

    Page 6 of 17

    6. Save your new AppEngine program. Click on File, Save As or Click on .Type a name for your program (please follow established nam ing conventionsexplained in UNTSP Standards docum ent found in the Shared Documents

    section of the EIS Developer Forum w ebsite), then click on OK (or press

    ENTER).

    Note: You must save your AppEngineprogram before the SQL or PeopleCode

    Editor windows are accessible.

    7. Now you need to add some Actions to your program (so it will actually dosomething!). To insert an Action (without inserting another Step along with theAction), either

    a. Right-click on the area to the left of Step01 and click on Insert Action.or

    b. Click once on Step01 to highlight it and click on

    The default action (SQL) will be inserted directly below Step01.

    Right-click in this area

    and click on Insert Action

    GBUT_00_EX1

  • 8/6/2019 AppEngine Exer 1

    7/17

    Page 7 of 17

    8. Double-click in the area to the left of the SQL Action to open the SQL Editor.

    9. Type the following SQL command into the SQL Editor window:

    UPDATE PS_GBUT_AETRN1_TBL

    SET AMT = AMT + (AMT * 10/100)

    WHERE DEPARTMENT = 'T R N T E C H x x '

    Please substitute your computer number for the xx in TRNTECHxx. Thiscommand will increase the hourly pay rate by 10% for all employees in yourdepartment.

    10.Click on to check the syntax of the SQL statement. Important note this willnot validate that your SQL is correct (i.e., correct table name, correct field names,etc). It will basically reformat your SQL the way it wants it to look. Misspellingnames or misplaced commas or parentheses will cause runtime errors.

    11.Close the SQL editor window.

    12.This program should also write a message to the Process Scheduler Message Logto indicate the action completed successfully. Because this message should bewritten out only if there were no errors encountered with the SQL executed inStep01, the message should be in a step by itself. To insert a Step and Action inone motion, either

    Double-click in this area

    to open the SQL Editor

  • 8/6/2019 AppEngine Exer 1

    8/17

    Page 8 of 17

    a. Right-click in the area to the left of Step01 and click on InsertStep/Action or

    b. Click once on Step01 to highlight it and click on

    Your display should now look like this:

    13.Since you dont need a SQL action in the new Step02, change the actionperformed to Log Message using the Action drop-down list.

    14.The Log Message Action uses the PeopleSoft Message Catalog, which is accessed

    via the web. Any message used in this Action must already exist. Navigation tothe Message Catalog is PeopleTools > Utilities > Use > Message Catalog.

    15.Once you have selected Log Message and tabbed off that field, the parametersavailable for the Action will change to appear as shown.

    Click here for a drop-

    down list of Actions

  • 8/6/2019 AppEngine Exer 1

    9/17

    Page 9 of 17

    16.Click on the box below Message Set: and type the Message Set number (see theUNTSP Stand ards docum ent found in the Shared Docum ents section of the EIS

    Developer Forum w ebsite for the appropr iate ran ge of Message Set num bers for

    your app lication ). Then click on the box below Number: and type the number

    for the message contained in the specified message set that you wish to use. Forthis exercise, use M e s s a ge S e t 2 0 10 1 a n d M e s s a ge N u m b e r 1.

    17.Save your program.

    Now, you are almost ready to test your AppEngine program! In order to run anAppEngine program, you must first create a Run Control Page and a Component tocontain the page, add the Component to a Menu, and set Security for the Component.

    To create a Run Control Page:

    If you do not need to accept input parameters from the user when this AppEngineprogram is executed, you can use the generic Run Control Page delivered by PeopleSoft.You can do that for this exercise because you are not accepting input from the user.(Note: For an example of creating a Run Control Page that includes parameters, pleasesee Exercise #2.)

    To create a Component for the Run Control Page:

    1. Click on File, New or click on

    2. Click on Component, then click on OK

  • 8/6/2019 AppEngine Exer 1

    10/17

    Page 10 of 17

    3. On the toolbar, click on Insert, then Page into Component. Click onPRCSRUNCNTL to highlight and click Insert.

    4. Before the Component can be saved, a search record must be specified. Click on

    to open the Properties window and click on the Use tab. SelectPRCSRUNCNTL as the search record, and then click on OK.

  • 8/6/2019 AppEngine Exer 1

    11/17

    Page 11 of 17

    5. Click on File, Save or click on .

    6. Type a name for the Component (please follow established na m ing conventionsexplained in UNTSP Standards docum ent found in the Shared Documents

    section of the EIS Developer Forum w ebsite) and click on OK.

    You next need to add the Component to a Menuhowever, since we cant all update the menu atonce, the instructor will do this for you. Please let the instructor know when you ar e ready

    to have your run control component added to the menu):

    T h e i n s t r u c to r w i ll a ls o p e r fo r m t h e n e c es s a r y s t e p s t o a d d s e c u r it y t o t h e

    m e n u i te m fo r y o u d u r i n g c la s s .

    The last step before you can run the AppEngine program youve created is to create aProcess Definition for the PeopleSoft Process Scheduler. This step must be completedwhether you are running the AppEngine program two-tier, three-tier, or n-tier.

    To create a Process Definition:

    1. On the web, navigate to PeopleTools > Process Scheduler Manager > Use >Process Definitions

    2. Click on the hyperlink Add a New Value

    3. Click on the lookup icon and then click on Lookup4. Click on the hyperlink Application Engine5. Type in the Process Name T h is m u s t m a t ch y o u r Ap p E n g in e p r o g r a m

    n a m e !

    GBUT_00_EX1

  • 8/6/2019 AppEngine Exer 1

    12/17

    Page 12 of 17

    6. Click on Add7. Click on the Process Definition Options tab8. In the Component section of the form, click on the Lookup icon and select your

    Component (this will be the Component that contains your Run Control Page)9. In the Process Groups section of the form, click on the Lookup icon and select the

    permission list used with this AppEngine program (in this exercise useALLPANLS)

    10.Click on Save

    Believe it or not, you are finally ready to run your AppEngine program!

    First, check the hourly pay rate on the employees in your department. This can beaccomplished either by accessing the records through the web navigation listed at thetop of this document.

    To execute your AppEngine program via the web:

    1. Navigate to the Menu Item you added (Tools Training > AE Training >TRNTECHxx > Increase Pay Rate 10% (where xx is your computer number)menu. The Run Control Search Page will be displayed.

    2. If you have an existing Run Control ID you want to use, you can type the name(or partial name) and click on Find. If you want to add a new one, click on the

    Process name should be GBUT_xx_EX1

    (where xx is your computer number).

  • 8/6/2019 AppEngine Exer 1

    13/17

    Page 13 of 17

    hyperlink Add a New Value then type a value for the Run Control ID and clickon Add. This can be any value you wishit does not need to match theAppEngine program name and can be reused.

    3. When the Run Control Page is displayed, click on Run.

    Click here to run AE program

  • 8/6/2019 AppEngine Exer 1

    14/17

    Page 14 of 17

    4. A page containing a list of all Process Definitions linked to this Component (viaSecurity) is displayed. Since the Process Definition name must match yourAppEngine program name, this provides the link that PeopleSoft will need toknow which program to run. Click on OK to submit the Process SchedulerRequest.

    Click here to complete submittal of request

    Note: If this pagecomes up and no

    processes aredisplayed, then you

    forgot to create aProcess Definition

    for your AppEngine

    program.

  • 8/6/2019 AppEngine Exer 1

    15/17

    Page 15 of 17

    5. The display will return to the Run Control Page and display your ProcessInstance. You can now click on the hyperlink Process Monitor to view theprogress of your program execution.

    You should be able to locate your program in the list.

  • 8/6/2019 AppEngine Exer 1

    16/17

    Page 16 of 17

    The Process Monitor can also be found at PeopleTools > Process Monitor >Inquire > Process Requests.

    6. Click on the hyperlink Details next to your process instance. A page showinginformation about your programs execution is displayed.

  • 8/6/2019 AppEngine Exer 1

    17/17

    Page 17 of 17

    7. Click on the hyperlink Message Log. This will display anything written to theMessage Log (remember the Log Message action you added to your program?).The first message was written by our program. The second message is a defaultmessage that writes out for any AppEngine program to indicate the log file waswritten to the report repository.

    8. If your program had not completed successfully, the hyperlink View Log/Tracecould provide meaningful information for troubleshooting.

    9. Lastly, you should verify that your program did what it was supposed to bychecking that your employees got a raise!