08/03/2016

Implementing a new Mobile Approval Type (Part 3)

In Implementing a new Mobile Approval Type (Part 1) I talked about the initial configuration you need to make in Enterprise Components > Approvals > Approvals > Mobile Approval Options > Transactions page and how that configuration gets reflected when viewing new Mobile Approvals. In Implementing a new Mobile Approval Type (Part 2)  I talk about the Application Package PeopleCode Classes that are required for Mobile Approvals, plus one other Record Definition. In this post I demonstrate how the custom classes/methods were called during page load and mouse clicks events. I reviewed Trace Files to determine which methods are called and in what order they were called. The screenshots and classes refer to our custom TOIL App Package Classes. But I think the delivered App Package Classes, for say the Absence Mobile Approvals, defined in the GP_ABS_EVT_HANDLER App Package, could also be referred to. But if you need any clarification please let me know. I may be able to provide our custom code.

Pending Approvals Page Loaded

Custom Methods that are Called

  1. DataHandler.OXF_TOIL
  2. DataHandler.GetApprovalItemRowset
  3. DataHandler.PopulateItemForList

Screen Shot


TOIL Hours on Left Clicked

Custom Methods that are Called

  1. DataHandler.OXF_TOIL
  2. DataHandler.GetApprovalItemRowset
  3. DataHandler.PopulateItemForList

Screen Shot


TOIL Request Clicked / TOIL Details Page Loaded

Custom Methods that are Called

  1. DataHandler.OXF_TOIL
  2. DataHandler.RetrieveApprovalItemDetail
  3. DataHandler.PopulateItemSummaryForDetail
  4. DetailDocument.ConstructDocument
  5. SubPage.OXF_TOIL
  6. SubPage.AddDynamicButton
  7. SubPage.RenderPage
  8. TOIL_Workflow.Thread_Descr
  9. TOIL_Workflow.getThreadDescr
  10. TOIL_Workflow.getUserName
  11. DataHandler.OXF_TOIL
  12. Ajax.IsRequireToRunPreApprovalProcess

Screen Shot


TOIL Line Clicked

Custom Methods that are Called

  1. DataHandler.OXF_TOIL
  2. DetailDocument.OXF_TOIL
  3. DetailDocument.ConstructDocument
  4. SubPage.OXF_TOIL
  5. SubPage.AddDynamicButton
  6. SubPage.RenderPage

Screen Shot

With RenderPage Processing

Without RenderPage Processing


TOIL Deny Clicked

Custom Methods that are Called

  1. TOIL_Workflow.Event_Handler
  2. TOIL_Workflow.OnHeaderDeny
  3. Comments.AddApplicationComments

Explanation

AddApplicationComments is what inserts the comments entered on the page.

TOIL Approved Clicked

Custom Methods that are Called

  1. DataHandler.OXF_TOIL
  2. Ajax.PreApprovalProcess
  3. TOIL_Workflow.Event_Handler
  4. TOIL_Claim.TOIL_Claim
  5. TOIL_Claim.Update_TOIL_Entitlement
  6. Results_Build.Results_Build
  7. Results_Build.Schedule_Update_Balances
  8. TOIL_Workflow.OnHeaderApprove
  9. Comments.AddApplicationComments
  10. DataHandler.OXF_TOIL
  11. DataHandler.GetApprovalItemRowset
  12. DataHandler.OXF_TOIL
  13. DataHandler.GetApprovalItemRowset

Explanation

AddApplicationComments is what inserts the comments entered on the page.

The final 2 calls to DataHandler.OXF_TOIL and DataHandler.GetApprovalItemRowset are likely from the Pending Approvals page being displayed again, which is normally where you get redirected to after approving something.

07/03/2016

Implementing a new Mobile Approval Type (Part 2)

In Implementing a new Mobile Approval Type (Part 1) I talked about the initial configuration you need to make in Enterprise Components > Approvals > Approvals > Mobile Approval Options > Transactions page and how that configuration gets reflected when viewing new Mobile Approvals. In this post I talk about the Application Package PeopleCode Classes that are required for Mobile Approvals, plus one other Record Definition .

Delivered Documentation

There seems to be very little documentation delivered by Oracle on how to implement a custom AWE Process in the new MAP-built Approval pages. The one place something is mentioned is this PeopleBook: Using the PeopleSoft Fluid User Interface to Work with Approvals where it mentions that the Root Package ID specified on the Enterprise Components > Approvals > Approvals > Mobile Approval Options > Transactions page (see Implementing a new Mobile Approval Type (Part 1)) and that this is the "application package that holds the DataHandler, DetailDocuement and SubPage classes for the transaction."

Custom Classes

Besides the DataHandler, DetailDocuement and SubPage listed in the documentation, there are two other classes required: Ajax and Comments.

These five class types have to be defined using this naming structure:

<Root Package>:<Class Type>:<AWE Process ID>

So for our custom TOIL Approval Workflow, the AWE Process ID is OXF_TOIL and the Root Package we used was OXF_ABSENCE_MGMT. So the five Classes were defined like this:
  • OXF_ABSENCE_MGMT:Ajax:OXF_TOIL
  • OXF_ABSENCE_MGMT:Comments:OXF_TOIL
  • OXF_ABSENCE_MGMT:DataHandler:OXF_TOIL
  • OXF_ABSENCE_MGMT:DetailDocuement:OXF_TOIL
  • OXF_ABSENCE_MGMT:SubPage:OXF_TOIL

Ajax Class

Extends
HMAP_APPROVAL:Ajax:AjaxInterface
Defines
AdhocAJAXFunction
Use
Could be used to implement Check Eligibility functionality. We have not implemented that functionality.
Defines
PreApprovalProcess
Use
Can be used to check Forecasting or other prerequisites required before allowing a User to Approve a request. In our case, we have no such prerequisite checks so we are setting everything to "Success".
Defines
IsRequireToRunPreApprovalProcess
Use
Always returns true. Maybe if it was set to false then the PreApprovalProcess method wouldn't get run when the request was approved.
Defines
CheckEligibility
Use
Defined, and coded, but not in use. Would be called from AdhocAJAXFunction, if there was a Check Eligibility button added to the Approval page.

Comments Class

Extends
HMAP_APPROVAL:ApprovalComments
Defines
method AddApplicationComments
Use
Once the Approval Item has been Approved, if there has been a comment added by the Approver, then the appropriate comment field on the appropriate table gets updated

DataHandler Class

Extends
HMAF_AWE:MOBILE:Handler:ApprovalFrameworkBase
Defines
GetApprovalItemRowset
Use
Perform a select against TOIL AWE View to return (as a rowset) all of the Outstanding TOIL Requests awaiting approval. Used for populating the number of TOIL requests on left hand side of Pending Approvals. And for populating the list of Pending Approvals on right hand side whenever TOIL or All is selected on left hand side.
Defines
PopulateItemForList
Use
Sets the action flags based on configuration on Enterprise Components > Approvals > Approvals > Mobile Approval Options > Transactions page. Makes reference to header record for TOIL (OXF_TOIL_EE_PRD) but it isn't actually used. Formats the data of each pending TOIL Approval you see on right hand side of pending approvals page when you have selected TOIL Hours on left hand side.
Defines
RetrieveApprovalItemDetail
Use
Perform a select against TOIL AWE View to return (as a record) all the details of a selected outstanding TOIL Request that is awaiting approval.
Defines
PopulateItemSummaryForDetail
Use
Similar to PopulateItemForList. Sets the action flags based on configuration on Enterprise Components > Approvals > Approvals > Mobile Approval Options > Transactions page. Makes reference to header record for TOIL (OXF_TOIL_EE_PRD) but it isn't actually used. Sets the following which is then passed in to a delivered method:
  • ItemDate
  • ItemKey
  • ItemType
  • TotalItemLines
  • EmplID
  • EmplRcd
  • RequestorComments

DetailDocument Class

Extends
HMAP_APPROVAL:Document:Data:SubDetailInfoDataDocument
Defines
OXF_TOIL
Use
Constructor method.
Defines
ConstructDocument
Use
This is the method that builds the main detail page you see after you have selected one of the outstanding TOIL approvals from the Pending Approvals page. It is used for both the main TOIL page, along with the line subpage you see after selecting one of the TOIL lines associated with the request. For both, it starts by doing a select against the TOIL AWE View. For the main page, it then 1.) formats the information you see on the page: "TOIL Period", "Claim No", "Status" and "Total Hours", and 2.) does a select against OXF_TOIL_EE_EVT and for each row returned, it sets the "ItemKey" (made up of on OXF_ABS_TOIL_DT and OXF_TOIL_CODE Values), "Title" (the OXF_ABS_TOIL_DT Value), "Title1" (OXF_ABS_TOIL_HRS.Value concatenated with " Hours"), and "Description1" (TOIL Code description concatenated with OXF_ABS_TOIL_RSN Value). If it's the subpage instead, it does a select against OXF_TOIL_EE_EVT and formats the information you see on the page: "Date", "Hours Earned", "TOIL Code" and "TOIL Reason".

SubPage Class

Extends
HMAP_APPROVAL:Page:SubPageBase
Defines
OXF_TOIL
Use
Constructor method. Sets some labels. Also sets some other properties of the class (including a pointer to a HTML Definition - HMAP_SPB_ABS_CSS_JS - but it doesn't seemed to be used.)
Defines
AddDynamicButton
Use
Used if a Dynamic Button is needed on the Subpage. This is not used for TOIL Approvals (so only assuming this is the purpose of this method.)
Defines
RenderPage
Use
Used to format the display of main page and the subpage. If viewing subpage, it hides a couple of sections and turns the main data you see on subpage from 2 columns to one column. If viewing main page, it sets some labels and hides the Additional Info section.

TOIL AWE View

OXF_TOIL_AWE_VW is a new record definition based on record HGA_APPR_AWE_VW. The HGA_APPR_AWE_VW record is used in the code for the Absence Fluid Approvals.

When developing an AWE Process you create a Cross Reference View. For our OXF_TOIL AWE Process this view was called OXF_TOIL_XREF. This new view is very similar and joins in these tables: OXF_TOIL_EE_PRD (the Header record for the Approval), OXF_TOILPRD_TBL (a lookup table with descriptions), PERSON_NAME (the name of the person who has submitted the request), EOAW_STEPINST and EOAW_USERINST.

The record is referenced throughout the Application classes defined above, usually to gather TOIL data together to present to an Approver.

24/02/2016

New Release of Chrome Extension PS Utilities - with a fabulous new feature

Today the PS Utilities Chrome Extension has been updated to version 3.0.0. This latest release fixes a few minor bugs, updates the extension to better handle PeopleTools 8.54 (especially Fluid pages) and has one fabulous new feature: One-click to turn on PeopleCode and SQL Tracing!

How clunky is it to turn on and off tracing from within PIA? How many mouse clicks does it take to get to the Trace PeopleCode and Trace SQL components, choose your options and save each component? This new feature in PS Utilities hides all those mouse clicks. All you need is one click to turn on tracing and another click to turn it off.

There are 2 simple steps you need to perform to to get it working for you. You first need to enable the Tracing feature on the Features tab of the PS Utilities Options page. And you then need to perform a one time setup of PeopleCode and SQL Trace options under the new Tracing tab on the Options page. Here's a screen shot with my favourite Trace options selected. Notice that these options match the options you see if you go to PeopleTools > Utilities > Debug > Trace PeopleCode and PeopleTools > Utilities > Debug > Trace SQL.



Then on the PS Utilities Bar you need to press the icon to turn on tracing. And press the  icon to turn off tracing. It's as simple as that.

You will see the icon rotating when you login to PeopleSoft or if you navigate to some pages. It does this while it determines if your user ID has permissions to access the PeopleCode and SQL Trace components. If your user ID does not have permission to either of these components then you will see the  icon and you will be unable to turn on tracing.

Keep in mind that PS Utilities is unable to determine if a Trace is already being performed via these delivered options:
  1. Sign on page trace options
  2. Application server trace options
  3. PeopleTools > Utilities > Debug components: Trace PeopleCode or Trace SQL
  4. Built-in PeopleCode Functions SetTracePC or SetTraceSQL
If you want to turn on tracing for just a short period of time to trace some specific functionality (such as the click of a button or the save of a page), this new Trace feature of PS Utilities will make that so much easier. Try it out.

And if you have any feedback it would be greatly appreciated. You can leave a comment here on this blog post or you can submit a support request directly on the Chrome Store page for the extension.

23/02/2016

Implementing a new Mobile Approval Type (Part 1)

Introduction

Over the last year I have worked on an upgrade from HR9.0 / PeopleTools 8.52 to HR9.2 / PeopleTools 8.54. One of the most interesting things I worked on was implementing a new Mobile Approval type. My client had implemented a custom Approval Workflow Engine (AWE) process back in HR9.0 to handle the approval of Time Off In Lieu (TOIL) requests. And they wanted to make use of the new Mobile Application Platform (MAP) built Fluid Approval pages delivered in HR9.2. This required implementing a new mobile approval type for this custom AWE Process.

This blog post will be the first covering this implementation.

General comments about implementing TOIL Approval

Most of the configuration and code was based on the Absence Approval Setup. The OXFTOIL configuration added to Enterprise Components > Approvals > Approvals > Mobile Approval Options > Transactions page was based on the ABSENCE configuration on the same page. The TOIL Approvals App Package PeopleCode (to be reviewed in a later blog post) in OXF_ABSENCE_MGMT App Package was based on the PeopleCode in the GP_ABS_EVT_HANDLER App Package.

Mobile Approval Options

TOIL Approvals using the new (as of HR9.2/PT8.54) MAP built Approval Fluid pages is configured via Enterprise Components > Approvals > Approvals > Mobile Approval Options > Transactions page . Here are screenshots of the configuration entered on this page/component. And below I'll show how it relates to what users see and how the TOIL Approvals work.

  1. *Order
    You would think this value determines the order of the Transaction List you see on the Pending Approvals page. But have not been able to verify this is the case. (Maybe when changes to this value were made that an App Server or Web Server needed rebooting?)


  2. *Transaction ID
    Doesn't seem to be used other than to be the unique key in this list of Mobile Approval Transactions


  3. *Transaction Name
    The Transaction Name shows up in three different places
    1. Pending Approvals Page
    2. TOIL Approval Main Page
    3. TOIL Approval Line Detail Page


  4. *Process ID
    Ties this Mobile Approval configuration to an AWE Process defined in Enterprise Components > Approvals > Approvals > Transaction Registry


  5. Include in JQuery Mobile
    MAP can make use of JQuery Mobile. Have not seen anywhere this has been used so unsure how this setting will affect the TOIL Approval


  6. Allow Mass Approvals
    This has been turned off for TOIL (but is on for Absence Requests.) If it was on, on the Pending Approval page when TOIL Hours is selected on the left hand side, then on the right hand side the Approve and Deny buttons would be displayed above the list and check boxes would be displayed next to each TOIL Hour request.


  7. Transaction Group
    Unused. If Transaction Groups were defined in Enterprise Components > Approvals > Approvals > Mobile Approval Options > General Settings page , then you could possibly Group various Approval Transactions into one group.


  8. Transaction Handler Class
    Unused


  9. Root Package ID
    This is the PeopleCode App Package where all the work is done. (To be reviewed in a later blog post)


  10. Approve
    On. Means the Approve button is displayed on the TOIL Approval Main Page


  11. Deny
    On. Means the Deny button is displayed on the TOIL Approval Main Page


  12. Pushback
    Off. Means the Pushbck button is NOT displayed on the TOIL Approval Main Page


  13. Hold
    Off. Means the Hold button is NOT displayed on the TOIL Approval Main Page


  14. Request Information
    Off. Means the Request Information button is NOT displayed on the TOIL Approval Main Page


  15. *Small Image
    Image used is MAP_TIME. Sets the image a user sees in the list of Approval Transactions on left hand side of Pending Approvals page.


  16. Medium Image
    Not set. Unsure of it's use.


  17. Large Image
    Not set. Unsure of it's use.


How Configuration is Reflected in MAP Pages

Pending TOIL Approvals

  • Transaction Name (TOIL Hours) is displayed in three places on this page. 
  • Because Allow Mass Approvals is off, the Check Box and Approve and Deny buttons are not displayed on this page. 
  • MAP_TIME image is displayed to the left of TOIL Hours on left hand side list of outstanding approval types.

TOIL Approval Main Page

  • Transaction Name (TOIL Hours) is displayed in one place on this page. 
  • Approve and Deny buttons are displayed on this page 
  • Pushback, Hold and Request Information buttons are NOT displayed on this page

TOIL Approval Line Detail Page

  • Transaction Name (TOIL Hours) is displayed in one place on this page.

What else?

The most important part of implementing Mobile Approvals is the App Package PeopleCode that is required. I hope to cover that in an upcoming post. Stay tuned.