Below is the Approval Process Setup:
Application Package Code
import EOAW_CORE:DEFN:UserListBase;
class ZZ_ApprUserList extends EOAW_CORE:DEFN:UserListBase
method ZZ_ApprUserList(&rec_ As Record);
method GetUsers(&aryPrevOpr_ As array of string, &thread_ As Record) Returns array of string;
end-class;
method ZZ_ApprUserList
/+ &rec_ as Record +/
%Super = create EOAW_CORE:DEFN:UserListBase(&rec_);
end-method;
method GetUsers
/+ &aryPrevOpr_ as Array of String, +/
/+ &thread_ as Record +/
/+ Returns Array of String +/
/+ Extends/implements EOAW_CORE:DEFN:UserListBase.GetUsers +/
Local array of string &oprid_arr = CreateArrayRept("", 0);
Local string &REQUESTOR, &ORIGIN;
Local number &req_amt, &SIGN_AUTH, &PREV_SIGN_AUTH;
Local string &oprid;
SQLExec("SELECT B.REQUESTOR_ID, B.ORIGIN FROM PS_REQ_HDR B WHERE B.REQ_ID = :1 AND B.BUSINESS_UNIT = :2", &thread_.REQ_ID.Value, &thread_.BUSINESS_UNIT.Value, &REQUESTOR, &ORIGIN);
If &ORIGIN = "DIR" Then
SQLExec("SELECT sum(A.MERCHANDISE_AMT) FROM PS_REQ_LINE A WHERE A.REQ_ID = :1 AND A.BUSINESS_UNIT = :2 ", &thread_.REQ_ID.Value, &thread_.BUSINESS_UNIT.Value, &req_amt);
Local SQL &admin_sql = CreateSQL("select OPRID ,MERCHANDISE_AMT from PS_ZZ_WF_AUTH_VW D START WITH D.OPRID = :1 CONNECT BY PRIOR SUPERVISOR_ID = D.OPRID", &aryPrevOpr_ [1]);
Local number &counter = 0;
While &admin_sql.Fetch(&oprid, &SIGN_AUTH)
&counter = &counter + 1;
If &counter > 1 Then
If &SIGN_AUTH > 0 Then
Break;
End-If;
End-If;
End-While;
SQLExec("SELECT MERCHANDISE_AMT FROM PS_ZZ_WF_AUTH_VW WHERE OPRID = :1", &aryPrevOpr_ [1], &PREV_SIGN_AUTH);
If &aryPrevOpr_ [1] = &REQUESTOR Then
rem the previous approver was the requestor, so we have to have one approver regardless of signing authority
so add this user to the approver array;
&oprid_arr.Push(&oprid);
Else
If &req_amt > &PREV_SIGN_AUTH Then
&oprid_arr.Push(&oprid);
End-If;
End-If;
End-If;
Return &oprid_arr;
end-method;
Things to know.
- All User list extend the EOAW_CORE:DEFN:UserListBase
- Needs to Return an Array of User Ids
- AWE will call this User List until the user list returns an empty array.











