Metodo para El Workflow de Licencias de Lucho
Metodo para El Workflow de Licencias de Lucho
---------------------aduseradhoc
import EOAW_CORE:LaunchManager;
import EOAW_CORE:ApprovalManager;
Component EOAW_CORE:LaunchManager &c_aweLaunchManager;
Component EOAW_CORE:ApprovalManager &c_aweApprManager;
If &c_aweApprManager.hasAppInst Then
/* Save ad hoc approvers. */
&c_aweLaunchManager.appInst.SaveAdHocs();
End-If;
----------------------------------------------------------------------------------------Hi,
We are on a process to upgrade HCM application to 9.1 and PT 8.52. We are trying
to customize AWE for 'Job Change' transaction to add adhoc approvers by initiat
ing manager or approvers.To do this I have over ridden allowInsert and allowDele
te methods in Adhoc Access Logic class of HR_TRANSFER package to return true, ad
ded Ad Hoc User List and events (On Adhoc Delete, On Adhoc Insert) in 'Configure
Transactions'.
By making these changes we are able to add adhoc approver as an Administrator, b
ut when logged in as approver I see the '+' icon, clicked + to select the potent
ial approver and no approver is added to an approval path.
We further investigated and see that Administrator component is refering to Comp
onent EOAW_ADMIN_MON, Page EOAW_ADM_MON_ACT, SubPage: EOAW_MON_SBP, Record EOAW_
MON_WRK whereas Job Change refers to Component HR_TRANSFER_APPR, Page: HR_TRANSF
ER_EE, SubPage: HCSC_MON_SBP, Record HCSC_MON_WRK. They both differs in the appl
ication packages they use.
Below is a code I have written on HCSC_MON_WRK.EOAW_FC_HANDLER.FieldFormula to i
nvoke the status monitor.
import
import
import
import
HMAF_AWE:ApprovalsFactory;
HMAF_AWE:INTERFACES:IApprovalManager;
HCSC_USERLIST_UTILS:*;
HMAF_AWE:INTERFACES:IStatusMonitor;
&Transaction_Name = "HR_TRANSFER";
&isAdmin = False;
/*Collect the values you need for acting on the transaction*/
Local Record &MyHeaderRec = GetLevel0()(1).GetRecord(Record.HR_TRANSFER_DAT);
/*Create Approvals Factory - We are creating this again so that we are using the
operator set
for the attribute record*/
/*Instantiate the Factory*/
&AprvFactory = create HMAF_AWE:ApprovalsFactory();
/*Instantiate the ApprovalManager object*/
&AprvMgr = &AprvFactory.getApprovalManager("TransferE mployee", &MyHeaderRec, %O
peratorId);
/* If any action is taken, then need to rebuild the approval chain and hide all
these buttons*/
&monitor = &AprvFactory.getStatusMonitor(&AprvMgr.the_ inst, "A", Null);
&monitor.showAll = True;
HCSC_MON_WRK.HTMLAREA = &monitor.buildHTML();
And, below is a code I have written on HR_TRANSFER.adhocAccessLogic application
class:
import EOAW_MONITOR:ADHOC_OBJECTS:adhocAccessLogicBase;
import EOAW_CORE:ENGINE:*;
class adhocAccessLogic extends EOAW_MONITOR:ADHOC_OBJECTS:adhocAccessLogicBase
method adhocAccessLogic();
method allowInsert(&oprid As string, &stepBefore As EOAW_CORE:ENGINE:StepInst, &
stepAfter As EOAW_CORE:ENGINE:StepInst) Returns boolean;
method allowDelete(&oprid As string, ¤tStep As EOAW_CORE:ENGINE:StepInst)
Returns boolean;
method allowNewPath(&oprid As string, &stage As EOAW_CORE:ENGINE:StageInst) Retu
rns boolean;
end-class;
method adhocAccessLogic
%Super = create EOAW_MONITOR:ADHOC_OBJECTS:adhocAccessLogicBase();
end-method;
method allowInsert
/+ &oprid as String, +/
/+ &stepBefore as EOAW_CORE:ENGINE:StepInst, +/
/+ &stepAfter as EOAW_CORE:ENGINE:StepInst +/
/+ Returns Boolean +/
/+ Extends/implements EOAW_MONITOR:ADHOC_OBJECTS:adhocAccessLogicBase.al lowInse
rt +/
Local boolean &Adhoc_Insert_Allow;
&Adhoc_Insert_Allow = True;
Return &Adhoc_Insert_Allow;
end-method;
method allowDelete
/+ &oprid as String, +/
/+ ¤tStep as EOAW_CORE:ENGINE:StepInst +/
/+ Returns Boolean +/
/+ Extends/implements EOAW_MONITOR:ADHOC_OBJECTS:adhocAccessLogicBase.al lowDele
te +/
Local boolean &Adhoc_Insert_Delete;
&Adhoc_Insert_Delete = True;
Return &Adhoc_Insert_Delete;
end-method;
method allowNewPath
/+ &oprid as String, +/
/+ &stage as EOAW_CORE:ENGINE:StageInst +/
/+ Returns Boolean +/
/+ Extends/implements EOAW_MONITOR:ADHOC_OBJECTS:adhocAccessLogicBase.al lowNewP
ath +/
Return False;
end-method
If anyone can please help if I am missing anything to get it to work so that Adh
oc approvers may be added by originator and by other approvers.Thanks in advance
!
--------------------------------------------------------------Hello All,
Is it possible to setup the AWE for the below situation?
Step 0: Employee A -> A Manager Submit a AWE Request
Step 1: Employee B -> Report Manager of Employee A Check the Workflow Item
----------> If Employee B Approved, then AWE Route to Next Level Chain
----------> If Employee B Deny, then AWE Denied & End
Step 2: Employee C -> A Specific Manager to Check the Workflow Item
----------> If Employee C Approved, then AWE Route to Next Level Chain
----------> If Employee C Denied, then AWE Route to Next Level Chain. (Note: the
denial here is ONLY by Terms, technically in AWE it will still call the DoAppro
ve() method to do the Approve action, however the Deny option will be stored in
a supporting field to indicate if the Employee is Routing the AWE to Next Level
Chain with Approval or Denial option.)
----------> In Short, whatever Action Employee C performed, the AWE Workflow wil
l ALWAYS route to Next Level Chain.
Step 3: Dynamic Employee -> Depend on the Action Employee C in Step 3 above perf
ormed
----------> Employee D
Higher Level Manager (If in Step 3, Employee C Choose to
Deny, ONLY in Terms NOT the AWE Deny Action)
----------> AWE Admin
AWE Administrator (If in Step 3, Employee C Choose to Appr
ove)
AWE Workflow Ends depend on Dynamic Employee (Employee D or AWE Admin) choosing
Hi Saxon, I'm looking to do add an adhoc path during the wf process as well. Not
as complex as yours, but were you able to figure this out? It's been several mo
nths now.
There is a method InsertAdhocParallel() that I'm looking into, located in EOAW_C
ORE.StageInst.OnExecute. I'll reply again with my results.
-------------------------------------------------------------yes its possible to insert adhoc step...try this code
&adhocStateObj.reInit();
&adhocStateObj.stepAfter = &stepInstId; /*pass Step Instance*/
&adhocStateObj.adhocPosition = "serial";
&adhocStateObj.stage = 10; /*pass Stage Nbr*/
&adhocStateObj.thread = &threadid; /*pass ThreadID*/
&adhocStateObj.adhocType = "approver";
&adhocStateObj.oprID = &OPRID; /*NOTE: This will insert only one approver. You c
annot insert multiple approvers*/
EOAW_MON_WRK.EOAW_FU_HANDLER.Value = "insert:";
EOAW_MON_WRK.HTMLAREA = &monitor.updateHTML(EOAW_MON_WRK.EOAW_FU_HANDLE R);
EOAW_MON_WRK.EOAW_FU_HANDLER = "";