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.

12/08/2015

Save PeopleCode to File

I've worked with a few people who perform a search for a semi-colon character ( ; ) in PeopleCode in the Find In dialog box and use the Save PeopleCode to File option. They do this so all PeopleCode can be saved to a file. And then whenever they want to perform a search they will search the file instead of using the Find In dialog box again. Using a text editor to search the file is usually MUCH quicker than using the Find In dialog box.

I think people use semi-colon for their search because they think every piece of PeopleCode must have one. This in fact is wrong. Here is a 30 line piece of Record FieldChange PeopleCode that will save and compile using PeopleTools 8.54.13. (Granted - it is non-sensical. But I'm just proving the point that not all PeopleCode must have a semi-colon.)

This PeopleCode program makes use of a wide variety of built-in functions and language constructs, such as:
  • If, Else, End-If
  • Evaluate, When, When-Other, End-Evaluate
  • Upper, Lower, String
  • Abs, Max, AccruableDays
  • %Date
  • For, End-For, Exit
  • Try, Throw, Catch, End-Try
  • CreateJavaObject, CreateException
  • Error, MsgGet
  • RECORD.FIELD notation
The moral of this story is: keep in mind that not all PeopleCode has a to have a semi-colon. And if you use the Find In PeopleCode, semi-colon ( ; ), Save PeopleCode to File option, realise that you may not have all your PeopleCode saved to your file. Even though it can be slow, I use the Find In dialog box. I just time other things around it, like writing a blog post.

/* Comment of course */
Evaluate PSOPRDEFN.OPRID
When = "VP1"
   If PSOPRDEFN.OPRID = Upper("cc") And
         "y" <> "z" Then
      If ("a" = "B") Then
         While 1 = 1
            PSOPRDEFN.OPRID = Lower("AA")
         End-While
      End-If
   End-If
   <* Comments too *>
When = "PS"
   If Abs(1.0) = Max(AccruableDays(%Date, %Date, 0)) Then
      Return
   End-If
When-Other
   For &intCounter = 1 To PSOPRDEFN.FAILEDLOGINS
      try
         If &intCounter = Round(100.12912, 0) Or
               String(&intCounter) = CreateJavaObject("String", "Hello").concat(" World") Then
            Exit
         Else
            throw CreateException(2, 160, "'%1' doesn't support property or method '%2'", "SomeClass", "SomeMethod")
         End-If
      catch Exception &exc
         Error MsgGet(0, 0, "hello world!")
      end-try
   End-For
End-Evaluate

25/03/2014

How to Handle a Job Definition with a Deleted Process Definition

We are currently in the middle of a Financials 8.9 to 9.2 Upgrade. One of the changes delivered is the old delivered Journal Post COBOL (GLPPPOST) has been replaced with a new App Engine called GL_JP. The old COBOL was included in a custom Job Definition. Following the 9.2 upgrade process we were left with our Job Definition that still included the old Process Definition, even though it was deleted as part of the upgrade. Following the upgrade one of my colleagues tried to delete the old Process Definition from the Job Definition and replace it with the new one. But they received this error when trying to save:
"The attempt to use CreateProcessRequest was unsuccessful because the system was unable to find the Process Name/Process Type from the Process Scheduler Definition table. Verify the Process Name/Process Type passed as parameters are valid. If this is a single process,check if the process is found in the Process Definition. If this is a Job(with process type of 'PSJob), check if the job is found in the Job Definition."
This is due to some SaveEdit processing where the Job Definition tries to verify if there is any recursive references in the Job. Because it does this in SaveEdit, it appears it is trying to verify the old version of the Job Definition with the old Process Definition, which of course doesn't exist. (I think this is because Jobs and Process Definitions are cached. I may be wrong on this however.) So how to get around it? I found a reference on the Oracle Support website mentioning the workaround of recreating the Job Definition. But if it is a complicated Job Definition with many Job Items, I think the simplest way to get around the issue is to:
  1. Temporarily re-create the Process Definition
  2. Delete this Process from the Job (because the Process Definition now exists, the SaveEdit processing will run to success)
  3. Add the new Process Definition to the Job
  4. Delete the Process Definition. To do this you need to:
    1. Create a temporary Application Designer project definition
    2. Add the Process Definition
    3. On the Upgrade Tab for Process Definitions change the Action for this Process Definition from Copy to Delete
    4. Save the Project to file (take note of location where you save it)
    5. Choose Tools, Copy Project, From File... and select the file you just created
    6. It will likely prompt you that the Definition already exists in the Database. If it does select Use Project Definition from: File and click OK
    7. Then click Copy to copy the project from file, deleting the Process Definition you created in the first step above.
You are then left with a Job Definition which includes the new Process Definition. And the old Process Definition again has been deleted.

This gets around the issue following the upgrade. I think the better way is to not have the issue to begin with. I think modifying the upgrade steps so the Job Definition gets updated prior to the old Process Definition being deleted would be better. Which is what I will be telling another colleague who is responsible for managing the upgrade.

05/03/2014

Attachments issue in Google Chrome with PeopleTools version 8.53.10

I was just assigned a PeopleTools 8.53 issue where an attachment can't be added in Google Chrome web browser. The attachment modal dialog is displayed and you can choose the file to upload. But when you click the Upload button the dialog disappears but the screen remains blue and nothing is clickable/editable. A search on Oracle Support returns a solution: https://support.oracle.com/epmos/faces/DocContentDisplay?_afrLoop=11708355275664&id=1628372.1&_afrWindowMode=0&_adf.ctrl-state=zuq8xq9w7_4 The solution is a temporary workaround as the bug is not due to be fixed until PeopleTools 8.54. The workaround as provided works but in some situations (most notably the home page) the code throws the error Uncaught ReferenceError: bLoadCompleted is not defined. 

So instead of adding the line of code as suggested

|| bLoadCompleted 

a better solution would be to add this

|| (typeof bLoadCompleted != "undefined" && bLoadCompleted)

Using the typeof bLoadCompleted != "undefined" prevents the Uncaught ReferenceError: bLoadCompleted is not defined.  from being displayed. And now your web browsers debugging console won't get filled up with errors.