PeopleSoft workflow
Requirement
To implement custom
workflow to approve Course Addition in an Educational training centre.
Approach
Define the required
components needed to create the workflow – The Rules, Roles, Routings and the
Business Process Maps and code logic to route the worklist to the approver.
Sl.
No
|
Test Scenario
|
Expected Results
|
1
|
Create a
course in the Courses page and try to approve the course with the role of
“CENTRE CLERK”
|
The page
should not allow the user with the role of CENTRE CLERK to approve the
course. The course should be forced to be saved in Pending Approval status
|
2
|
Navigate to
the Course Approvals page as user with “CENTRE CLERK” role and try to approve
the transaction.
|
The page
should not allow the user with the role of CENTRE CLERK to approve the
course. The course should be forced to be saved in Pending Approval status
|
3
|
Navigate to
the Course Approvals through clicking worklist as user with “CENTRE_MANAGER”
role.
|
The page
should allow the user to approve the course with the role of CENTRE MANAGER.
|
Fields
Sl.
No
|
New / Existing
|
Field Name
|
Data Type
|
Length
|
1
|
NEW
|
COURSE_ID
|
CHAR
|
5
|
2
|
NEW
|
COURSE_NAME
|
CHAR
|
15
|
3
|
NEW
|
COURSE_DUR
|
NUMBER
|
4
|
4
|
NEW
|
COURSE_STATUS
|
CHAR
|
4
|
Records
Sl.
No
|
New / Existing
|
Record Name
|
Record Type
|
1
|
NEW
|
COURSE
|
Standard
|
2
|
NEW
|
COURSE_A_WL
|
Standard
|
3
|
NEW
|
COURSE_APV_VW
|
SQL View
|
Record Fields
COURSE
Sl.
No
|
Field Name
|
Key
|
Data Type
|
Length
|
Table Edit Type
(Prompt/Translate )
|
1
|
COURSE_ID
|
Yes
|
CHAR
|
5
|
None
|
2
|
COURSE_NAME
|
CHAR
|
15
|
None
|
|
3
|
COURSE_DUR
|
NUMBER
|
4
|
None
|
|
4
|
COURSE_STATUS
|
CHAR
|
4
|
Translate
|
|
5
|
APPROVAL_ID
|
CHAR
|
30
|
None
|
|
6
|
APPROVAL_DATE
|
DATE
|
10
|
None
|
|
7
|
DTTM_STAMP
|
DATE TIME
|
26
|
None
|
COURSE_A_WL
Sl.
No
|
Field Name
|
Key
|
Data Type
|
Length
|
Table Edit Type
(Prompt/Translate )
|
1
|
BUSPROCNAME
|
Yes
|
CHAR
|
30
|
None
|
2
|
ACTIVITYNAME
|
Yes
|
CHAR
|
30
|
None
|
3
|
EVENTNAME
|
Yes
|
CHAR
|
30
|
None
|
4
|
WORKLISTNAME
|
Yes
|
CHAR
|
30
|
None
|
5
|
INSTANCEID
|
Yes
|
NUMBER
|
10
|
None
|
6
|
TRANSACTIONID
|
Yes
|
NUMBER
|
10
|
None
|
7
|
COURSE_ID
|
Yes
|
CHAR
|
5
|
None
|
8
|
DTTM_STAMP
|
DATE TIME
|
26
|
None
|
COURSE_APV_VW
Sl.
No
|
Field Name
|
Key
|
Data Type
|
Length
|
Table Edit Type
(Prompt/Translate )
|
1
|
COURSE_ID
|
Yes
|
CHAR
|
5
|
None
|
2
|
COURSE_NAME
|
CHAR
|
15
|
None
|
|
3
|
COURSE_STATUS
|
CHAR
|
4
|
Translate
|
|
4
|
APPROVAL_ID
|
CHAR
|
30
|
None
|
|
5
|
APPROVAL_DATE
|
DATE
|
10
|
None
|
|
6
|
DTTM_STAMP
|
DATE TIME
|
26
|
None
|
COURSE_APV_VW
Sl.
No
|
Record (View) Name
|
View Text
|
1
|
COURSE_APV_VW
|
SELECT course_id
,
course_name
,
course_status
,
approval_oprid
,
approval_date
,
dttm_stamp
FROM ps_course
WHERE course_status IN ('PA')
|
Translate Values
Sl.
No
|
Field Name
|
Translate Value
|
XLAT Short name
|
XLAT Long Name
|
Effective Date
|
1
|
COURSE_STATUS
|
A
|
Approved
|
Approved
|
01/01/1900
|
O
|
Open
|
Open
|
01/01/1900
|
||
PA
|
Pending Approval
|
Pending
Approval
|
01/01/1900
|
Pages
Sl.
No
|
New / Existing
|
Page Name
|
Page Type
(Standard/Sub-page/Secondary)
|
1
|
New
|
COURSE_PG
|
Standard
|
2
|
New
|
COURSE_APPR
|
Standard
|
Page Design
COURSE_PG
COURSE_APPROVAL
Sl.
No
|
New / Existing
|
Component Name
|
Search Record /
Add Search record
|
Menu Name
|
1
|
New
|
COURSE_CMP
|
COURSE
|
EMP_ADDR_MNU
|
2
|
New
|
COURSE_APPROVAL
|
COURSE_APV_VW
|
EMP_ADDR_MNU
|
PeopleCode Customizations
Sl.
No
|
PeopleCode type
|
Object Name
|
Event Name
|
1
|
Record PeopleCode
|
COURSE .
COURSE_STATUS
|
Field
Change
|
2
|
Record
PeopleCode
|
COURSE .
COURSE_ID
|
Save Pre
Change
|
3
|
Component
PeopleCode
|
COURSE_CMP
|
Workflow
|
4
|
Component
PeopleCode
|
COURSE_APPROVAL
|
Save Pre
Change
|
Work Flow
Business Process
Map
Step Attributes
Event Properties
Worklist
Attributes
Worklist Mappings
Roles
Sl.
No
|
PEOPLESOFT
ROLENAME
|
Description
|
1
|
CENTRE
CLERK
|
A clerk who
proposes new courses based on market study
|
2
|
CENTRE
MANAGER
|
The manager
who reviews the clerk’s suggestion and approves.
|
PeopleSoft Project Name
Sl.
No
|
New / Existing
|
PeopleSoft Project Name
|
Description
|
1
|
NEW
|
WORKFLOW_PRJ
|
Workflow
Project
|
CODE
COURSE .
COURSE_STATUS . Field Change (Record Peoplecode)
&oprid =
%OperatorId;
SQLExec("SELECT ROLENAME FROM PSROLEUSER WHERE ROLEUSER = :1 AND ROLENAME LIKE 'CENTRE%'", &oprid, &rolename);
If &rolename <> "CENTRE_MANAGER" Then
If COURSE.COURSE_STATUS = "A" Then
WinMessage("You do not have sufficient
authority to approve this course. This enters workflow");
COURSE.COURSE_STATUS = "PA";
End-If;
End-If;
COURSE . COURSE_ID . SavePreChange (Record Peoplecode)
If %Component = Component.COURSE_CMP Then
&oprid = %OperatorId;
SQLExec("SELECT ROLENAME FROM PSROLEUSER WHERE ROLEUSER = :1 AND ROLENAME LIKE 'CENTRE%'", &oprid, &rolename);
If &rolename = "CENTRE_MANAGER" Then
COURSE.COURSE_STATUS = "A";
COURSE.APPROVAL_OPRID = &oprid;
COURSE.APPROVAL_DATE = %Date;
End-If;
COURSE.DTTM_STAMP = %Datetime;
End-If;
If %Component = Component.COURSE_APPROVAL Then
&oprid = %OperatorId;
SQLExec("SELECT ROLENAME FROM PSROLEUSER WHERE ROLEUSER = :1 AND ROLENAME LIKE 'CENTRE%'", &oprid, &rolename);
If &rolename = "CENTRE_MANAGER" Then
COURSE.COURSE_STATUS = "A";
COURSE.APPROVAL_OPRID = &oprid;
COURSE.APPROVAL_DATE = %Date;
End-If;
End-If;
COURSE_CMP .
Workflow (Component Peoplecode)
&oprid =
%OperatorId;
SQLExec("SELECT ROLENAME FROM PSROLEUSER WHERE ROLEUSER = :1 AND ROLENAME LIKE 'CENTRE%'", &oprid, &rolename);
If &rolename = "CENTRE_CLERK" Then
&temp = TriggerBusinessEvent(BusProcess."COURSE_APPROVALS", BusActivity."COURSE_APPROVAL", BusEvent."Course_Approval");
End-If;
COURSE_APPROVAL .
SavePrechange (Component Peoplecode)
&oprid =
%OperatorId;
SQLExec("SELECT ROLENAME FROM PSROLEUSER WHERE ROLEUSER = :1 AND ROLENAME LIKE 'CENTRE%'", &oprid, &rolename);
If &rolename <> "CENTRE_MANAGER" Then
COURSE.COURSE_STATUS = "PA";
End-If;
Comments
Post a Comment