ApprovalManager Class Methods
The approval manager object is the application developers interface to the Approval Framework. Most developers will not find it necessary to directly access any other Approval Framework objects. Application developers should instantiate this class as a component-scoped variable. The best place to initialize this class is in the component post-build event. The class can be instantiated with information readily available to developers at component post-build time. Developers should examine the boolean-valued properties of this object to know whether or not the user entering the approval component has any pending approvals work. If there are any pending approvals, the GetPending() method will identify what is pending, and the action methods such as DoApprove(), or DoDeny(), will enable them to implement the full approval functionality.
This section lists the Approval Manager class methods in alphabetical order.
ApprovalManager
Syntax
ApprovalManager(&awprcs_id, &hdr_, &approver_)
Description
Developers need to know their transaction id, and need to pass in an instance of their application's main record, which describes the request being submitted for approval. They also need to explicitly tell the Approval Framework who the approver is.
Parameters
Parameter |
Description |
---|---|
&awprcs_id |
The approval Process ID that has been defined in the Transaction Registry, as string. |
&hdr_ |
The header record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
&approver_ |
The Operator ID of the user approving the transaction, as string. |
Example
import EOAW_CORE:*; Component EOAW_CORE:ApprovalManager &approvalMgr; &vchrRecord = CreateRecord(Record.VCHR_AF_HDR_VW); GetLevel0()(1).GetRecord(Record.VCHR_FS).CopyFieldsTo(&vchrRecord); &approvalMgr = create EOAW_CORE:ApprovalManager("VoucherApproval",&vchrRecord, %UserId);
DoApprove
Syntax
DoApprove(&rec)
Description
Use this method to approve the transaction for the record.
Parameters
Parameter |
Description |
---|---|
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
DoApproveRowSet
Syntax
DoApproveRowSet(&rs)
Description
Use this method to approve transactions for the entire rowset. If this is a line-level record, then all paths which had routed this record to the approver are advanced.
For example, if an expense report has 3 lines o and you want to approve all 3 lines, you would insert the records into a rowset and pass that rowset to DoApproveRowset. Approval Framework will approve each line in that rowset. This avoids repeated calls to Approve.
Parameters
Parameter |
Description |
---|---|
&rs |
Rowset to approve, as rowset. |
Returns
None.
DoReassign
Syntax
DoReassign(&rec, &reassignee, &bAllowAutoApprove, &bAllowSelfApprove, &comment)
Description
Use this method to reassign the record instance to a different approver.
Parameters
Parameter |
Description |
---|---|
&rec |
The transaction record to be reassigned, as record. |
&reassignee |
The user to reassign the approval to, as string. |
&bAllowAutoApprove |
Indicate whether or not auto approval is active, as boolean. |
&bAllowSelfApprove |
Indicate whether or not self approval is active, as boolean. |
&comment |
Include any comments, as string. |
Returns
String.
DoReassignAll
Syntax
DoReassignAll(&reassignee, &bAllowAutoApprove, &bAllowSelfApprove, &comment)
Description
Note: Use this method to reassign all line items for the transaction to a different user for approval.
Parameters
Parameter |
Description |
---|---|
&reassignee |
User ID to reassign the transactions to, as string. |
&bAllowAutoApprove |
Indicate whether or not auto approval is active, as boolean. |
&bAllowSelfApprove |
Indicate whether or not self approval is active, as boolean. |
&comment |
Include any comments, as string. |
Returns
String.
DoDeny
Syntax
DoDeny(&rec)
Description
Use this method to deny approval on a record instance. If the record is a header record, then the approval process ends. If the record is a line-level record, that particular line's processing ends, while the other records in that transaction continue.
Parameters
Parameter |
Description |
---|---|
&rec |
The record name defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
Returns
None.
Example
&approvalMgr.DoDeny(&reqRecord);
DoDenyRowset
Syntax
DoDenyRowset(&rs)
Description
Use this method to deny approval on a rowset. This is used to enable Approval Framework to deny multiple lines at once rather than looping through each line.
Parameters
Parameter |
Description |
---|---|
&rs |
Name of the rowset, as rowset. |
Returns
None.
DoDenyWithAllowUndeny
Syntax
DoDenyWithAllowUndeny(&rs)
Description
Use this method to deny approval on a rowset, where resubmits are not allowed.
Parameters
Parameter |
Description |
---|---|
&rs |
Name of the rowset, as rowset. |
Returns
None.
DoHardDeny
Syntax
DoHardDeny(&rec)
Description
Use this method to deny approval on a record instance and not allow re-submits. If the record is a header record, then the approval process ends. If the record is a line-level record, that particular line's processing ends, while the other records in that transaction continue.
Parameters
Parameter |
Description |
---|---|
&rec |
The record name defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
Returns
None.
DoLineResubmit
Syntax
DoLineResubmit(&rec, &start)
Description
Allows the line being passed in to be resubmitted to a running transaction. The user decides if the line is restarted from the current stage or the beginning. If it starts from the beginning, all history after the first header stage is lost.
Parameters
Parameter |
Description |
---|---|
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
&start |
Use True to start at the beginning of the approval process or False to start at the current stage. |
Returns
None.
Example
&approvalMgr.DoLineResubmit(&reqLnRecord, True);
DoAddNewLine
Syntax
DoAddNewLine(&rec, &start)
Description
Use to allow the line being passed in to be added to a running transaction. The user decides if the line is restarted from the current stage or the beginning. If it starts from the beginning, all history after the first header stage is lost.
Parameters
Parameter |
Description |
---|---|
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
&start |
Use True to start at the beginning of the approval process or False to start at the current stage. |
Returns
None.
GetPending
Syntax
GetPending()
Description
This method returns a rowset in the form of the applications header or line record that includes any header row or line row that is pending.
Parameters
None.
Returns
Rowset containing pending transactions.
Example
&LINERS = CreateRowset(Record.PV_REQLIN_AW_VW); &LINERS = &approvalMgr.GetPending();
DoPushback
Syntax
DoPushback(&rec)
Description
Use this method to send the process back to the previous approver. This is used to give the approver a means of requesting a prior approver to make a clearer case for approving the transaction.
Note: Pushback only works to push back the workflow to a prior step in the same path. Calling Pushback() on the first step its path does nothing.
Parameters
Parameter |
Description |
---|---|
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
Returns
None.
Example
&approvalMgr.DoPushback(&reqRecord);
AddComments
Syntax
AddComments(&username, &rec, &comments)
Description
Use this method to add comments in the approval process.
Parameters
Parameter |
Description |
---|---|
&username |
The user name for the current user, as string. |
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
&comments |
Comments for the approval transaction, as string. |
Returns
None.
Example
&approvalMgr.AddComments(getUserName(%OperatorId), &reqRecord, PV_REQ_APPPG_WK.COMMENTS_2000);
TakeNoAction
Syntax
TakeNoAction(&rec)
Description
Use this method to update the user's status as no action taken. If all approvers at this step take no action, then the step will advance and the current step will store the status for No Action Taken.
Parameters
Parameter |
Description |
---|---|
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
Returns
None.
PutOnHold
Syntax
PutOnHold(&rec)
Description
Used to put the record instance passed in on hold for this step. If this is a line-level record, then all paths which had routed this record to the approver are advanced.
Parameters
Parameter |
Description |
---|---|
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
Returns
None.
PutOnHoldCount
Syntax
PutOnHoldCount(&rec)
Description
This method is used to count how many approvers have put an approval transaction on hold. For example, if there are 10 approvers and 5 approvals are needed, checking to see that 3 approvers put it on hold will tell you that there are still 7 approvers that have not looked at the transaction yet.
Parameters
Parameter |
Description |
---|---|
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
Returns
Array of string.
GetPushedBack
Syntax
GetPushedBack()
Description
Use this method to retrieve all the rows in a transaction that were pushed back.
Returns
Rowset.
GetPertinentThreads
Syntax
GetPertinentThreads(&checkApprover, &userType)
Description
Use this method to determine what threads are pending review or approval.
Parameters
Parameter |
Description |
---|---|
&checkApprover |
As string. |
&userType |
As string. |
Returns
Rowset.
GetStage
Syntax
GetStage(&rec)
Description
Use this method to retrieve the current stage of the approval process for a transaction.
Parameters
Parameter |
Description |
---|---|
&rec |
The record defined for the approval processes in the Transaction Approval Levels in the Transaction Registry, as record. |
Returns
EOAW_CORE:ENGINE:StageInst
GetPendingSteps
Syntax
GetPendingSteps()
Description
Use this method to determine all pending steps for an approval process. This method returns a list of step-instance objects pending for this transaction.
Parameters
None.
Returns
Array of EOAW_CORE:ENGINE:UserStepInst.
DoLineTerminate
Syntax
DoLineTerminate(&LineRec)
Description
Use this method to terminate the given line level approval.
Parameters
Parameter |
Description |
---|---|
&LineRec |
The line level record for the approval process. |
GetParticipant
Syntax
GetParticipant(&username)
Description
Use this method to determine whether or not the user is a participant in the approval process. This method returns the participation status for a user that is currently pending or has taken an action.
Parameters
Parameter |
Description |
---|---|
&username |
User ID, as string. |
Returns
Returns a string to determine user participation in the approval process:
N- if the user is not a participant in the approval.
AA- if the user is the actual approval.
OA- if the user is the original approval.
RR- if the user is a reviewer.
O- if the user is the originator.
R- if the user is the requestor.
GetAllActiveParticipants
Syntax
GetAllActiveParticipants()
Description
Use this method to retrieve a list of all users that have either been flagged as Approvers, Reviewers, requestor or initiator.
Parameters
None.
Returns
Array of string.
RequestInformation
Syntax
RequestInformation(&user, &rs)
Description
Use this method to put a step on hold until the specified user provides more information.
Parameters
Parameter |
Description |
---|---|
&user |
UserID to insert as a reviewer and request information from, as string. |
&rs |
Rowset to push the reviewer onto the step, as rowset. |
Returns
None.
SetAttributeObject
Syntax
SetAttributeObject(&attrObj_)
Description
Use this method to set the Approval Attribute class on the Appinst class.
Parameters
Parameter |
Description |
---|---|
&attrObj |
As EOAW_CORE:ENGINE:AppAttributes. |
Returns
None.