0% found this document useful (0 votes)
121 views

Leave Workflow Save Button Flow

The document outlines the steps involved in approving a record in an application. It involves: 1) Calling the ConfirmAction method which calls the DoApprove method of the ApprovalManager interface. 2) The ApprovalManager interface's DoApprove method internally calls the ApprovalManager wrapper's OnExecute method. 3) The OnExecute method calls the PTAF_CORE:ApprovalManager's DoApprove method.

Uploaded by

charan7429
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views

Leave Workflow Save Button Flow

The document outlines the steps involved in approving a record in an application. It involves: 1) Calling the ConfirmAction method which calls the DoApprove method of the ApprovalManager interface. 2) The ApprovalManager interface's DoApprove method internally calls the ApprovalManager wrapper's OnExecute method. 3) The OnExecute method calls the PTAF_CORE:ApprovalManager's DoApprove method.

Uploaded by

charan7429
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Step1: Save Button FieldEdit Step2: Save Button FieldChange Step3: ConfirmAction(&Action) ( OK_BUTTON - FieldFormula - Function Conf irmAction(&Action

As string)) rem TransferPage(Page.GP_ABS_SS_CONFIRM); Step4: Save Button FieldChange ( Actually code is there in Yes-Button FieldCha nge ) When "APV" &Action = "FINAPV"; /* venkat - Begin*/ rem WinMessage(" When APV & &Action = FINAPV " | &Action, 0); /* venkat - End*/ &AprvMgr.DoApprove(&Dat_Rec); Step5: Component HMAF_AWE:INTERFACES:IApprovalManager &AprvMgr; (This is an Int erface) Step6: HMAF_AWE.WRAAPPERS.ApprovalManager.OnExecute method DoApprove /+ &rec as Record +/ /+ Extends/implements HMAF_AWE:INTERFACES:IApprovalManager.DoApprove +/ /* venkat - Begin*/ rem WinMessage(" HMAF_AWE.WRAAPPERS.AppeovaklManager. Method DoApprove: ", 0 ); /* venkat - End*/ &ApprovalMngr.DoApprove(&rec); end-method; Step7: age method ApprovalManager /+ &awprcs_id as String, +/ /+ &hdr_ as Record, +/ /+ &approver_ as String +/ /+ Extends/implements HMAF_AWE:INTERFACES:IApprovalManager.ApprovalManager +/ rem WinMessage("method ApprovalManager"); %Super = create HMAF_AWE:INTERFACES:IApprovalManager(); &ApprovalMngr = create PTAF_CORE:ApprovalManager(&awprcs_id, &hdr_, &approver _); &pushbackEnabled = &ApprovalMngr.pushbackEnabled; end-method; Internally it is calling: HMAF_AWE.WRAPPERS.ApprovalManager.OnExecute: HMAF_AWE.WRAPPERS.ApprovalManager.OnExecute: HMAF_AWE.WRAPPERS.ApprovalManager.OnExecute: HMAF_AWE.WRAPPERS.ApprovalManager.OnExecute: ager PTAF_CORE:ApprovalManager.DoApprove(&rec); method ApprovalManager &hdr_ Record &approver_ 64793 &ApprovalMngr PTAF_CORE:ApprovalMan instance PTAF_CORE:ApprovalManager &ApprovalMngr; is an Allication Pack

PTAF_CORE:ApprovalManager.OnExecute

method DoApprove /+ &rec as Record +/ /* venkat - Begin*/ WinMessage(" Step 3 PTAF. aPPROVALmANAGER.method DoApprove /* venkat - End*/

" | &inst, 0);

WinMessage("PTAF_CORE:ENGINE:AppInst ||| &inst = " | &inst, 32); &inst.SaveAdHocs(); &inst.Approve( False, &rec, &approver); &needsRefresh_ = True; end-method; Step8: Next Calling method SaveAdHocs Local number # For &num = 1 To &stages_.Len &stages_ [&num].SaveAdHocs(); End-For; &isChanged = False; end-method; method Approve /+ &byAdmin as Boolean, +/ /+ &apprec as Record, +/ /+ &approver as String +/ /* venkat - Begin*/ WinMessage(" Step 4 &apprec.CopyFieldsTo &apprec.Name " | &apprec.Name, 0); /* venkat - End*/ Local Rowset &localRS = CreateRowset(@("Record." | &apprec.Name)); &apprec.CopyFieldsTo(&localRS.GetRow(1).GetRecord(@("Record." | &apprec.Name) )); &localRS.InsertRow(1); %This.ApproveByRowSet(&byAdmin, &localRS, &approver, %This.appDef.txn.GetLeve lOfRec(&apprec.Name)); end-method; Here data is inserting into the GP_ABS_SS_DAT Record Step09: Next Calling %This.ApproveByRowSet(&byAdmin, &localRS, &approver, %T his.appDef.txn.GetLevelOfRec(&apprec.Name)); method ApproveByRowSet /+ &byAdmin as Boolean, +/ /+ &apprecRS as Rowset, +/ /+ &approver as String, +/ /+ &level as Number +/ instance PTAF_CORE:ENGINE:AppInst &inst, &old_inst;

Local Local Local Local , 0);

number &index; Record &apprec; PTAF_CORE:ENGINE:Thread &the_thread; array of PTAF_CORE:ENGINE:Thread &threads = CreateArrayRept(&the_thread

For &index = 1 To &apprecRS.ActiveRowCount &apprec = &apprecRS(&index).GetRecord(@("Record." | %This.appDef.txn.GetRe cAtLevel(&level))); &the_thread = %This.FindAppRecThread(&apprec); If (&the_thread <> Null) Then &threads.Push(&the_thread); End-If; End-For; %This.ApproveByThread(&byAdmin, &threads, &approver); end-method; Step10: Next Calling Local PTAF_CORE:ENGINE:Thread &the_thread;

method FindAppRecThread /+ &apprec as Record +/ /+ Returns PTAF_CORE:ENGINE:Thread +/ If (%This.thread.MatchesAppRec(&apprec)) Then Return (%This.thread); Else Local array of PTAF_CORE:ENGINE:Thread &ch = %This.thread.GetChildren(); Local number &thr_indx; If (&ch = Null) Then Return Null; End-If; For &thr_indx = 1 To &ch.Len If (&ch [&thr_indx].MatchesAppRec(&apprec)) Then Return (&ch [&thr_indx]); End-If; End-For; End-If; Return Null; end-method; method ApproveByThread /+ &byAdmin as Boolean, +/ /+ &threads as Array of PTAF_CORE:ENGINE:Thread, +/ /+ &approver as String +/ %This.currentApprover = &approver; Local boolean &found = False; Local array of string &changed = CreateArrayRept("", 0); Local number &num, &thread_index; Local PTAF_CORE:ENGINE:Thread &procthread; Local array of PTAF_CORE:ENGINE:Thread &processed = CreateArrayRept(&procthre ad, 0); For &num = 1 To &stages_.Len If (&stages_ [&num].isPending Or &stages_ [&num].isOnHold) Then &processed = &stages_ [&num].Approve(&byAdmin, &threads, &approver, &ch anged);

/* We want to only process threads that still need to be processed. T hat way if two threads with the same approver are at different stages, we can ap prove them both. */ If (&processed.Len > 0) Then &found = True; End-If; If (&found And Not &appDef.isAutoApproving) Then /* reset the threads to only those that still need to be processed. */ If (&threads.Len = &processed.Len) Then Break; End-If; Local array of PTAF_CORE:ENGINE:Thread &temp = CreateArrayRept(&thre ad, 0); Local number &i; For &i = 1 To &threads.Len If (&processed.Find(&threads [&i]) = 0) Then &temp.Push(&threads [&i]); End-If; End-For; &threads = &temp.Clone(); End-If; End-If; End-For; If (&found) Then %This.UpdateTimestamp(); End-If; %This.CheckIfComplete(); %This.eventHandler.ProcessNotifications(%This); end-method; Step11:

You might also like