Appendix A. Business logic examples 149
Although it is permissible to do a string comparison using the internal date format with the
slashes removed as in this comparison, you must use the REXX Date() function with Base
dates in order to do any real mathematical processing:
days = date('b',date2,'s') - date('b',date1,'s')
The time values must also be converted for processing to minutes:
minutes1 = hhmm2min(S0C6A) /* Convert time occurred to mins */
minutes2 = hhmm2min(S0C71) /* Convert time completed to mins */
total_minutes = minutes2 - minutes1
It is possible for time 2 to be less than time 1 even though the date and time pair 2 actually
occurred after the date and time pair 1. In that case, total_minutes will be negative and a day
must be borrowed to make it positive:
/* Fix minutes to be positive if negative. */
if total_minutes < 0 then
do
days = days - 1
total_minutes = total_minutes + 1440
end
Before storing the calculated duration back into the Web Access record, the duration needs to
be reformatted:
hours = total_minutes % 60
minutes = total_minutes // 60
/* Total duration is in the DDDD:HH:MM format */
days = RIGHT(days,4,'0')
hours = RIGHT(hours,2,'0')
minutes = RIGHT(minutes,2,'0')
S50B9 = days||':'||hours||':'||minutes
S50B9.?type = 'D' /* Set data type */
Call Update_Data 'S50B9' /* Set Total Duration */
BLQUXVAL contains a similar routine to calculate the actual duration when the date
completed or time completed, or both, in a change or activity record changes. The actual start
date is used as the date and time pair 1.
Processing similar to this can be added for other date fields in Web Access, or this technique
can be employed in user Web applications.
Notification
The business logic for the Web Access drop-in problem and change management solution
uses the Information Management for z/OS notification feature to send e-mail messages
when certain conditions are met. The 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, but it can be modified to use queued notification. Both notification
methods are described in the
Tivoli Information Management for z/OS Program
Administration Guide and Reference, Version 7.1
, SC31-8753 (BLGS1E10), and the
email_tsx parameter is described in Business logic exit routine directives on page 169.
Web Access supplies a set of message model records and TSXs that, coupled with the
Information Management for z/OS notification TSXs, build and route the notification
messages used by the drop-in problem and change management solution's business logic.
150 IBM Tivoli Web Access for Information Management
Table 12-1 Web Access TSXs and message model records
E-mail recipients are defined by the e-mail address in their user profile, which is a people
record in the Information Management for z/OS database. If a notification message is
intended for you, but you do not have an e-mail address in your profile, the e-mail will not be
sent. The message TSXs determine to whom the e-mail is to be routed. Web Access does
not currently send e-mail to carbon copy (cc:) or blind carbon copy (bcc:), but it can be
modified to do this. Following is a brief description of the message TSXs used by Web
Access:
BLQTCHGAChange approval
Messages are sent to the eligible users in approver privilege classes whose approval status
is Pending.
BLQTNCNMRecord assigned
A message is sent to the assignee identified by s-word index 50C5.
BLQTNREPRecord opened
A message is sent to the person reporting an incident or submitting a request as identified by
the e-mail address in the incident or request.
The message templates follow. The message variables are substituted with actual data when
the message is built.
Example: A-10 BLQMAPPR: Change approval
Record !S0CCF is ready for you to approve. Click on the link below to
approve or reject this record.
http://yourhostname:yourport/IMWA/BLQWRGET.REXX?html_view=BLQ0C209.html&rnid_symbol=!S0CCF
Example: A-11 BLQMRSET: Change reapproval
The due date for change record !S0CCF was modified so the approvals
have been reset. The new due date is !S0C49. Click on the link below
to approve or reject this record.
http://yourhostname:yourport/IMWA/BLQWRGET.REXX?html_view=BLQ0C209.html&rnid_symbol=!S0CCF
Process Message model records Message TSX
Change approval
BLQMAPPR Change approval
BLQTCHGA
BLQMRSET Change reapproval
Record assigned
BLQMANOT Activity assigned
BLQTNCNMBLQMCNOT Change assigned
BLQNPNOT Problem assigned
Record opened
BLQMINOT Incident opened
BLQTNREP
BLQMRNOT Request opened

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.