Académique Documents
Professionnel Documents
Culture Documents
1 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
100
92
290
5/15/2016 7:53 AM
2 of 30
{ DBTutor }
PeopleSoft FAQ
About DBTutor
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
Database Server
Skill Test
You are here: Home PeopleCode Approval Workflow Engine Create A Simple AWE PeopleSoft Part 4
11
5/15/2016 7:53 AM
3 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
his Section will discuss about various PeopleCode that need to write In order to AWE Work
properly.
1. Part 1 Contains Record , Component , Pages & Menu Creation ( Create A Simple AWE
2. Part 2 Contains AWE Transaction Registration , Configuration , Approval Process & Generic
PeopleSoft )
Template Setup in thru PeopleSoft Portal ( Create A Simple AWE PeopleSoft Part 2 )
3. Part 3 Contains Testing & Demonstration AWE Workflow in PeopleSoft with different User (
Create A Simple AWE PeopleSoft Part 3 )
5/15/2016 7:53 AM
4 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
8.54
8.53
8.52
8.51
8.50
8.49
8.48
PeopleCode
People Code Type
Event Name
FieldChange
Object Name
ZZ_AWE_ACTN_WRK.EOAW_SUBMIT
View Results
5/15/2016 7:53 AM
5 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
SetComponentChanged();
End-If;
DoSave();
PeopleSoft Part 4
&c_sSubmitBtn = "Y";
Event Name
FieldChange
5/15/2016 7:53 AM
6 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
End-If;
DoSave();
&c_sSaveDraftBtn = "Y";
Code
Integration Broker
PeopleCode
MySQL
1
1
1
PeopleSoft Customization
PeopleSoft Fieldbook
Collection
1
4
PeopleTools
PS Query
5/15/2016 7:53 AM
7 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
Event Name
FieldChange
Object Name
ZZ_AWE_ACTN_WRK.EOAW_DENY
End-If;
DoSave();
5/15/2016 7:53 AM
8 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
Event Name
FieldChange
Object Name
ZZ_AWE_ACTN_WRK.EOAW_APPROVE
Select Month
5/15/2016 7:53 AM
9 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
Event Name
RowInit
Object Name
ZZ_AWE_HDR
ZZ_AWE_HDR.EMPLID.Value = %EmployeeId;
End-If;
ZZ_AWE_HDR Component
Event Name
PostBuild
Object Name
ZZ_AWE_HDR
5/15/2016 7:53 AM
10 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
Component Record &headerRec; /** We have set it Component Level, So Get Acess to Others Componen
Local boolean &isApprover = False; /** Checl if User is Approver for this transaction **/
/** Set Header Record, **/
&headerRec = GetRecord(Record.ZZ_AWE_HDR);
/** Get Assigned Approval Process Id for selected transaction From Workflow Transaction Page **/
&c_AWEProcessDefnID = "ZZ_AWE_SAMPLE"; /** Get EO Process Defn ID **/
/** Initialize the launch and approval managers. ApprovalManager will need reinitialization on s
&c_aweLaunchManager = create EOAW_CORE:LaunchManager(&c_AWEProcessDefnID, &headerRec, %UserId);
&c_aweApprovalManager = create EOAW_CORE:ApprovalManager(&c_AWEProcessDefnID, &headerRec, %UserI
5/15/2016 7:53 AM
11 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
&c_aweLaunchManager.definition = "ZZ_AWE_SAMPLE";
/** Show Transaction Status Monitor & Save & Submit Button **/
If &c_aweApprovalManager.hasAppInst Then
/* Toggle all fields with the exception of the status monitor as display only.
change the page property as the status monitor fields would be disabled */
We cannot
&Rs(1).GetRecord(&i).GetField(&j).DisplayOnly = True;
End-For;
End-For;
Else
ZZ_AWE_ACTN_WRK.EOAW_SUBMIT.Visible = True;
ZZ_AWE_ACTN_WRK.EOAW_SAVE.Visible = True;
End-If;
5/15/2016 7:53 AM
12 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
ZZ_AWE_ACTN_WRK.EOAW_SUBMIT.Visible = False;
ZZ_AWE_ACTN_WRK.EOAW_SAVE.Visible = False;
Else
ZZ_AWE_ACTN_WRK.EOAW_APPROVE.Visible = False;
ZZ_AWE_ACTN_WRK.EOAW_DENY.Visible = False;
End-If;
/*** Show Approve & Deny & Save & Submit Button Based on Condition End ***/
ZZ_AWE_HDR Component
Event Name
SavePreChange
Object Name
ZZ_AWE_HDR
5/15/2016 7:53 AM
13 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
ZZ_AWE_HDR.EMPLID.Value = %EmployeeId;
ZZ_AWE_HDR.SUBMIT_DTTM.Value = %Datetime;
&c_sSubmitBtn = "";
End-If;
ZZ_AWE_HDR.EMPLID.Value = %EmployeeId;
ZZ_AWE_HDR.WF_STATUS.Value = "V"; /** Set Data Saved As Draft **/
ZZ_AWE_HDR.SUBMIT_DTTM.Value = %Datetime;
&c_sSaveDraftBtn = "";
End-If;
End-If;
5/15/2016 7:53 AM
14 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
ZZ_AWE_HDR Component
Event Name
SavePostChange
Object Name
ZZ_AWE_HDR
/***
* This Save Post Change Code Will Handled When Submit, Approve & Deny Action Performed
**/
5/15/2016 7:53 AM
15 of 30
import EOAW_CORE:ApprovalManager;
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
Component Record &headerRec; /** We have set it Component Level, So Get Acess to Others Componen
Local boolean &IsActionTaken = True;
Local string &sActionMsgString = "";
Evaluate &c_sAppr_Action
When "V"
Break;
When "S"
If &c_aweLaunchManager.submitEnabled Then
&c_aweLaunchManager.DoSubmit();
End-If;
End-If;
5/15/2016 7:53 AM
16 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
end-try;
If (&c_aweLaunchManager.hasAppInst) Then
End-If;
Break;
When "A"
&c_aweApprovalManager.DoApprove(&headerRec);
&IsActionTaken = False;
end-try;
Break;
When "D"
&c_aweApprovalManager.DoDeny(&headerRec);
Break;
When-Other
&IsActionTaken = False;
End-Evaluate;
5/15/2016 7:53 AM
17 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
End-If;
/** Show Transaction Status Monitor & Save & Submit Button **/
If &c_aweApprovalManager.hasAppInst Then
ZZ_AWE_ACTN_WRK.EOAW_SAVE.Visible = False;
ZZ_AWE_ACTN_WRK.EOAW_APPROVE.Visible = False;
ZZ_AWE_ACTN_WRK.EOAW_DENY.Visible = False;
/* Toggle all fields with the exception of the status monitor as display only.
change the page property as the status monitor fields would be disabled */
Local Rowset &Rs = GetLevel0();
We cannot
End-For;
End-For;
End-If;
5/15/2016 7:53 AM
18 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
Event Name
OnExecute
Object Name
ZZ_AWE_EVENT_HANDLR
/***
* Approval Event Handler Class
5/15/2016 7:53 AM
19 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
import EOAW_CORE:ApprovalEventHandler;
import EOAW_CORE:ENGINE:AppInst;
import EOAW_CORE:ENGINE:UserStepInst;
import EOAW_CORE:ENGINE:StepInst;
import EOAW_CORE:ENGINE:Thread;
/** Constructor */
method ApprEventHandler
end-method;
method OnProcessLaunch
/+ &appinst as EOAW_CORE:ENGINE:AppInst +/
5/15/2016 7:53 AM
20 of 30
&HeaderRecord.SelectByKey();
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
&HdrRecTopKeyValue = &HeaderRecord.GetField(Field.REQUEST_ID).Value;
/** Update the Workflow Status **/
&recHdrRecord.GetField(Field.REQUEST_ID).Value = &HdrRecTopKeyValue;
If &recHdrRecord.SelectByKey() = True Then
End-If;
end-method;
method OnStepComplete
/+ &stepinst as EOAW_CORE:ENGINE:StepInst +/
/+ Extends/implements EOAW_CORE:ApprovalEventHandler.OnStepComplete +/
Local string &HdrRecTopKeyValue;
&stepinst.path.thread.SetAppKeys(&HeaderRecord);
&HeaderRecord.SelectByKey();
/** Retrieve Header Key field values **/
&HdrRecTopKeyValue = &HeaderRecord.GetField(Field.REQUEST_ID).Value;
/** Update the Workflow Status **/
&recHdrRecord.GetField(Field.REQUEST_ID).Value = &HdrRecTopKeyValue;
5/15/2016 7:53 AM
21 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
&recHdrRecord.GetField(Field.WF_STATUS).Value = "I";
&recHdrRecord.Update();
GetLevel0().Refresh();
End-If;
end-method;
method OnHeaderApprove
/+ &appinst as EOAW_CORE:ENGINE:AppInst +/
/+ Extends/implements EOAW_CORE:ApprovalEventHandler.OnHeaderApprove +/
Local string &HdrRecTopKeyValue;
&appinst.thread.SetAppKeys(&HeaderRecord);
&HeaderRecord.SelectByKey();
/** Retrieve Header field values **/
&HdrRecTopKeyValue = &HeaderRecord.GetField(Field.REQUEST_ID).Value;
/** Update the Workflow Status **/
End-If;
end-method;
5/15/2016 7:53 AM
22 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
/+ &userinst as EOAW_CORE:ENGINE:UserStepInst +/
/+ Extends/implements EOAW_CORE:ApprovalEventHandler.OnHeaderDeny +/
Local string &HdrRecTopKeyValue;
&userinst.thread.SetAppKeys(&HeaderRecord);
&HeaderRecord.SelectByKey();
&HdrRecTopKeyValue = &HeaderRecord.GetField(Field.REQUEST_ID).Value;
/** Update the Workflow Status **/
&recHdrRecord.GetField(Field.REQUEST_ID).Value = &HdrRecTopKeyValue;
If &recHdrRecord.SelectByKey() = True Then
&recHdrRecord.GetField(Field.WF_STATUS).Value = "D";
&recHdrRecord.Update();
GetLevel0().Refresh();
End-If;
end-method;
5/15/2016 7:53 AM
23 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
2. Part 2 Contains AWE Transaction Registration , Configuration , Approval Process & Generic
Template Setup in thru PeopleSoft Portal ( Create A Simple AWE PeopleSoft Part 2 )
5/15/2016 7:53 AM
24 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
Please share your comments & let me know if you stuck on this Sample AWE Workflow.I will
also share some advanced topics on approval framework , so stay tune.
PREVIOUS:
NEXT:
5/15/2016 7:53 AM
25 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
5/15/2016 7:53 AM
26 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
5/15/2016 7:53 AM
27 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
5/15/2016 7:53 AM
28 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
5/15/2016 7:53 AM
29 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
5/15/2016 7:53 AM
30 of 30
http://www.dbtutor.com/2015/01/10/create-simple-awe-peoplesoft-part-4
5/15/2016 7:53 AM