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.

No comments:

Post a Comment