Appendix A. Business logic examples 137
BLQUXFIL
BLQUXFIL runs after a new or updated record is filed. The main business logic code is
placed after the block comment that instructs you to
Put business logic code here. The text
in blue is code from the template BLQUEXIT, which was copied and renamed to BLQUXFIL.
The other text is the code that was added for the business logic.
Example: A-3 BLQUXFIL
/*********************************************************************/
/* Put business logic code here. Use Update_Data subroutine to */
/* write an updated or new variable and value to the read/write */
/* pool. */
/*********************************************************************/
/*********************************************************************/
/* Normally you do not want the business logic to run for the Admin */
/* Role. This allows the Administrator to control all the data. */
/* You can remove/relocate this line if you want all or part of the */
/* business logic to run in the Admin role. @01A*/
If translate(?ROLE) = 'ADMINISTRATOR' then exit 200 /*@01A*/
/* If updating a change record and status is now LOCKED, notify the */
/* approvers. Otherwise, check if the due date changed. If it did, */
/* reset the approval status to PENDING and notify approvers */
if ?MODE='UPDATE' & ?RECORD_TYPE='CHANGE' then
do
msg_rec='' /* clear notification msg id */
rnid_symbol=S0CCF /* Get the record id */
trans='USERTSP' /* Set the API transaction */
if Changed('S0BEE') then /* If status changed */
do
upper S0BEE /* Uppercase the status */
if S0BEE='LOCKED' then /* If status is now LOCKED, */
msg_rec='BLQMAPPR' /* Set notification message rnid */
Note: The following code notifies change approvers when there is a change ready for their review. A
change is ready for approval when its status is set to LOCKED. The code also checks whether a
change must be reapproved. A change must be reapproved if its due date is modified. If so, the
approval statuses are reset to PENDING, and change approvers are notified that they must
reapprove the change. This code uses the notification method identified by the email_tsx parameter
in the BLQPARMS file. As shipped, the email_tsx parameter is set for immediate notification.
a
Two
message model records are shipped with Web Access for change approval notification, BLQMAPPR
and BLQMRSET.
This code uses the Web Access REXX global variables ?MODE to determine if the user is updating a
record, and ?RECORD_TYPE to determine if the user is working with a change record. It uses the
Changed subroutine provided with the BLQUEXIT template to test whether the status (S0BEE) was
changed and, if not, whether the due date changed (S0C49).
If the due date changed, the HLAPI/REXX USERTSP transaction is invoked to reset the approval
statuses to PENDING, using the Information Management for z/OS TSX BLGTRPND.
Change approvers are notified by invoking the HLAPI/REXX USERTSP transaction using the
notification TSX specified by email_tsx and passing parameters msg_tsx set to BLQTCHGA, and the
msg_rec set to the message model record. The message is either that the change is ready for
approval (BLQMAPPR), or that the change must be reapproved (BLQMRSET).
a. Immediate and queued notification methods are described in
Tivoli Information Management for z/OS
Program Administration Guide and Reference, Version 7.1
, SC31-8753.
Get IBM Tivoli Web Access for Information Management now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.