This blog post i will discuss about trace options on AWE for hcm Employee Self Service & Manager Self Service approval workflow engine transaction.
Almost all transaction in mss are based on approval workflow engine, it is some time you might require to view trace specially when you have multiple states, path & criteria has been set on approval process setup.since all manager self service transaction are basted on HCM AWE wrapper class which is HMAF_AWE so you need to do some small workaround to set trace functionality. This very simple tweak and no delivered functionality has been hampered for that.
So lets discuss about the tweak and then show trace configuration.
Step 1
Open App Designer Search for HMAF_AWE as Application Package.
Step 2
Under WRAPPERS package Open LaunchManager Class
Step 3
Search For
property EOAW_CORE:DEFN:AppDef appDef
you can see the below screen shoots , i have comment out the delivered line , then copy it and paste into new line with below modifications. Please use your comments why you modified the the delivered code, it is good practice.
property EOAW_CORE:DEFN:AppDef appDef get set
Step 4
As you have declare get set property, now you need to declare body so add this at the end.
/** Added By Nayan For AWE Trace **/ /** Doc ID 1630877.1 **/ get appDef /+ Returns EOAW_CORE:DEFN:AppDef +/ /+ Extends/implements HMAF_AWE:INTERFACES:ILaunchManager.appDef +/ Return &LaunchMngr.appDef; end-get; set appDef /+ &NewValue as EOAW_CORE:DEFN:AppDef +/ /+ Extends/implements HMAF_AWE:INTERFACES:ILaunchManager.appDef +/ &LaunchMngr.appDef = &NewValue; end-set; /** Doc ID 1630877.1 **/ /** End By Nayan **/
Now you are done with workaround. Now lets move to awe trace.
Now Open any manager self service manager transaction request page ( end with _MGR). for this instance i will demonstrate “PromoteEmployee” transaction.
This Means Where the Source of AWE Transaction
All This Code Works Only Component SavePostChange events.
Add this line before DoSubmit Call.
/** Start Set AWE Trace True, For AWE Trace By Nayan Doc ID 1630877.1 **/ &LaunchMgr.appDef.trace_flag = True; /** End Set AWE Trace True, For AWE Trace By Nayan Doc ID 1630877.1 **/
Another Example
/* Launch the AWE Transation */ If &LaunchMgr.hasAppDef And &LaunchMgr.submitEnabled Then /** Start Set AWE Trace True, For AWE Trace By Nayan Doc ID 1630877.1 **/ &LaunchMgr.appDef.trace_flag = True; /** End Set AWE Trace True, For AWE Trace By Nayan Doc ID 1630877.1 **/ /** --- Before Dosubmit method Call --- **/ &LaunchMgr.DoSubmit();
Now you need to write File to view the trace.
/** ----- Put this Code at before Any Page Transfer * TransferPage(Page.FE_ADDRESS_STS); * RunWFSavePostChange("HR_PROMOTE_CONFIRM"); **/ /** Start Writing Files For AWE Trace By Nayan Doc ID 1630877.1 **/ If &LaunchMgr.appDef.trace_flag = True Then Local File &trace = GetFile("/psoft/HRDEV/appserv/HRUAT/LOGS/BNP_AWE_Trace_*.log", "N", "A", %FilePath_Absolute); &trace.WriteLine(&LaunchMgr.appDef.trace); &trace.Close(); End-If; /** End Writing Files For AWE Trace By Nayan Doc ID 1630877.1 **/
It is also good idea to write trace files only on Test or UAT environment , so that when you migrate this into production unnecessary trace file will not generate or put trace_flag as false whatever your choice.
/** Start Writing Files For AWE Trace By Nayan Doc ID 1630877.1 **/ If &LaunchMgr.appDef.trace_flag = True And %DbName = "HRUAT" Then Local File &trace = GetFile("C:\temp\Promotion_AWE_Trace_*.log", "N", "A", %FilePath_Absolute); &trace.WriteLine(&LaunchMgr.appDef.trace); &trace.Close(); End-If; /** End Writing Files For AWE Trace By Nayan Doc ID 1630877.1 **/
Now you are done with trace settings raise promote employee transaction from Main Menu – Manager Self Service – Job and Personal Information – Promote Employee
Upon transaction submission it will generate trace file with the specified location. Now lets view some of the sample trace files that i have generated.
What happened, you are not using HMAF_AW wrapper Class
If you are not using HMAF_AWE wrapper class in your custom approval application and you are using directly EOAW_CORE class then almost everything is same except launch manager class, please follow the steps.
You custom Application Request Component SavePostChange Code should be like that
/** Import Approval Framework Base Classes */ import EOAW_CORE:LaunchManager; import EOAW_CORE:ApprovalManager; import EOAW_MONITOR:CLASS_DEFAULTS:*; import DBT_ASSET_AWE_UI_HNDLR:controlUIFaceDisplay; Component EOAW_CORE:LaunchManager &c_aweLaunchManager; Component EOAW_CORE:ApprovalManager &c_aweApprovalManager; Component EOAW_MONITOR:CLASS_DEFAULTS:saveButtonLogicDefault &c_aweAdhocSaveButton;
Where you declare &c_aweLaunchManager as component level variable. So just set it Before DoSubmit
/**Set Trace Flag True , So that we can trace when Required/On Demand **/ &c_aweLaunchManager.appDef.trace_flag = True;
Write Files in previous way
/*** If Trace Flag Is Enabled then Writign Files We can Trace **/ If &c_aweLaunchManager.appDef.trace_flag = True Then Local File &AWETraceFile = GetFile("c:\temp\" | Upper(%UserId) | "_AWE_TRACE_" | %Datetime | ".log", "N", "A", %FilePath_Absolute); &AWETraceFile.WriteLine(&c_aweLaunchManager.appDef.trace); &AWETraceFile.Close(); End-If; /*** AWE Trace End ***/
Please let me know your view.
Hope this helps 🙂
Good information about AWE debugging using pplcode.What all tabels we use for debugging AWE?
Do you have a version of the above trace that works for PeopleSoft Financials?