Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : MESSAGE_LOG

MESSAGE_LOG
Preserves the contents of the message log across transactions. (C)
Invocation
CALL MESSAGE_LOG(msglog, destin)
 
VIEW – The logs appear as if you pressed PF2 from the workbench. Because you can see both the user and system logs, the msglog argument value is ignored.
LOG – The log is saved back to the message log and then the parent transaction can access it. Note  Whether or not the system log or user log is saved, it is written to the user log for the parent transaction.
filename – A string containing a dot (.) is interpreted as a filename. The log is written to the file. A new file is not created unless the file is a partitioned data set; then a new member could be created. The previous contents of the file or member are overwritten.
@LOGTEXT(parm) – The log is saved in the @LOGTEXT table in a table instance specified by:
The user ID of the person who invoked the rule that called MESSAGE_LOG
Usage Notes
To send the MESSAGE_LOG to a file in Windows or Solaris, the DSBIFTYPE Execution Environment parameter must be set to LINE_SEPARATED_ASCII. The default setting is LENGTH_PREFIXED_EBCDIC.
Output to a file and output to a printer are interconnected. If the program is expected to send output to a printer after this output is directed to a file, the print destination must be reset.
You can view the @LOGTEXT table using the Single Occurrence Editor, but the Table Editor cannot display strings as long as the field in this table. You can copy the contents to any other suitable table.
You can give the standard argument values in their lowest unique truncated form. For example, VIEW, VIE, and V all have the same effect.
See Also
TIBCO Object Service Broker Programming in Rules for more information about the message log.

Exceptions
 
If destin is VIEW, both logs are empty.
Raised if the value for msglog does not specify USER or SYSTEM, and the value for destin is not VIEW.
Raised if the value for destin does not specify one of the valid destinations (refer to the previous exception).
If you specified the @LOGTEXT(parm) value, the parameter name is not a valid TIBCO Object Service Broker identifier.
Raised if the value for destin is LOG and the user log overflowed.
Example
The set of rules in this example does the following:
1.
2.
Rule Using MESSAGE_LOG
The HIERARCHY rule executes the STAFF sample rule, saves the information in the message log by calling MESSAGE_LOG, and then executes MANAGER.

 
HIERARCHY(NUMBER);
_ ---------------------------------------------------------------------
_ ------------------------------------------------------------+--------
_ EXECUTE STAFF(NUMBER); | 1
_ CALL MESSAGE_LOG('USER', 'LOG'); | 2
_ EXECUTE MANAGER(NUMBER); | 3
_ ---------------------------------------------------------------------

 
Sample Rule 1
The STAFF rule uses the message log to list the people that work for the manager.

 
STAFF(NUM);
_
_ ---------------------------------------------------------------------
_ ------------------------------------------------------------+--------
_ CALL MSGLOG('THE FOLLOWING EMPLOYEES WORK FOR MANAGER ' || | 1
_ NUM || ':'); |
_ GET EMPLOYEE WHERE MGR# = NUM; | 2
_ FORALL EMPLOYEE WHERE MGR# = NUM: | 3
_ CALL MSGLOG(EMPLOYEE.LNAME); |
_ END; |
_ ---------------------------------------------------------------------
_ ON GETFAIL:
_ CALL MSGLOG(NUM || ' IS NOT A MANAGER.');

 
Sample Rule 2
The MANAGER rule uses the message log to display the manager of the manager.

 
MANAGER(NUM);
_
_ ---------------------------------------------------------------------
_ ------------------------------------------------------------+--------
_ CALL MSGLOG(' '); | 1
_ GET EMPLOYEE WHERE EMPNO = NUM; | 2
_ CALL MSGLOG('THE MANAGER OF ' || NUM || ' IS ' || | 3
_ EMPLOYEE.MGR#); |
_ ---------------------------------------------------------------------
_ ON GETFAIL:
_ CALL MSGLOG(NUM || ' IS NOT AN EMPLOYEE IN THIS DIVISION.');

 
Results of the HIERARCHY Rule
If the manager number is valid, and the manager is also entered as an employee in the EMPLOYEE table, results such as the following appear in the message log:

 
----------------------- INFORMATIONAL MESSAGE LOG --------------------
COMMAND ===> SCROLL ===> P
THE FOLLOWING EMPLOYEES WORK FOR MANAGER 79912:
SMITH
HRODEK
WONG
SCHULTZ
BOIVIN
THE MANAGER OF 79912 IS 98895

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved