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


Chapter 2 Using User Exits in Workbench Tools : How to Use the Exits

How to Use the Exits
Location of the Rules
The exit rules are stored in the system (COMMON) library. They are provided as stub rules and always return the string “Y”. This causes the affected tools to function as they did in the past.
Modifying an Exit
Using the appropriate sample stub rule as a base, modify the exit rule. The modified rule must return a string to the tool. Save the modified rule in the appropriate library, usually the installation (SITE) library.
Set the Search Path
You must ensure that the correct library search path for the modified tool is set in the workbench menu definition. Refer to TIBCO Object Service Broker Defining Screens and Menus for details about using the DEFINE_MENU tool to define workbenches and about using DEFINE_OBJLIST for object manager prompts.
Examples
The following examples show how you can:
The rules @ENTRY_VALIDATE and @PRE_SAVE_OBJECT are changed to test the CALLER argument.

 
RULE EDITOR ===> SCROLL: P
@ENTRY_VALIDATE(CALLER, TYPE, NAME, LIBRARY, NEW);
_
_ ---------------------------------------------------------------------------
_ CALLER = 'EDITRULE'; ¦ Y N N
_ CALLER = 'DEFINE_TABLE'; ¦ Y N
_ ------------------------------------------------------------+--------------
_ RETURN(VALIDRULENAME(NAME, LIBRARY)); ¦ 1
_ RETURN(VALIDTABLETYPE(TYPE, NEW)); ¦ 1
_ RETURN('Y'); ¦ 1
_ ---------------------------------------------------------------------------

 
If @ENTRY_VALIDATE is called by the Rule Editor, it calls VALIDRULENAME. If it is called by the Table Definer, it calls VALIDTABLETYPE.

 
RULE EDITOR ===> SCROLL: P
@PRE_SAVE_OBJECT(CALLER, TYPE, NAME, LIBRARY, NEW);
_
_ -------------------------------------------------------------------
_ CALLER = 'EDITRULE'; ¦ Y N N
_ CALLER = 'DEFINE_TABLE'; ¦ Y N
_ ------------------------------------------------------------+------
_ RETURN(VALIDRULENAME(NAME, LIBRARY)); ¦ 1
_ RETURN(VALIDTABLETYPE2(TYPE)); ¦ 1
_ RETURN('Y'); ¦ 1
_ ---------------------------------------------------------------------------
 
If @PRE_SAVE_OBJECT is called by the Rule Editor, it calls VALIDRULENAME. If it is called by the Table Definer, it calls VALIDTABLETYPE2.

 
RULE EDITOR ===> SCROLL: P
VALIDRULENAME(NAME, LIBRARY);
_
_ -------------------------------------------------------------------
_ LIBRARY ¬= 'ORDERED'; ¦ Y N N
_ HEADSTRING(NAME, 3) ¬= 'ED_'; ¦ Y N
_ ------------------------------------------------------------+------
_ RETURN('Y'); ¦ 1 1
_ RETURN('You can only edit rules starting with "ED_" in ' ¦ 1
_ || 'this library'); ¦
_ ---------------------------------------------------------------------------

 
VALIDRULENAME ensures that if a rule is to be edited or saved in this library, it must start with ED_.

 
RULE EDITOR ===> SCROLL: P
VALIDTABLETYPE(TYPE, NEW);
_
_ -----------------------------------------------------------------------
_ NEW; ¦ Y N N N N
_ HEADSTRING(USERID, 2) ¬= 'WE'; ¦ Y N N N
_ TYPE = 'TEM_TABLE'; ¦ Y N N
_ TYPE = 'SES_TABLE'; ¦ Y N
_ ------------------------------------------------------------+----------
_ RETURN('Y'); ¦ 1 1 1 1
_ RETURN( ¦ 1
_ 'Your user group can only define TEM and SES tables'); ¦
---------------------------------------------------------------------------

 
VALIDTABLETYPE and VALIDTABLETYPE2 ensure that users whose user ID starts with WE can define only a SES_TABLE or a TEM_TABLE.
VALIDTABLETYPE first checks the NEW flag because when a new definition is created, it starts out as a TDS_TABLE. Without this extra check, a user whose user ID starts with WE would be unable to create a new table.

 
RULE EDITOR ===> SCROLL: P
VALIDTABLETYPE2(TYPE);
_
_ ---------------------------------------------------------------------
_ HEADSTRING(USERID, 2) ¬= 'WE'; ¦ Y N N N
_ TYPE = 'TEM_TABLE'; ¦ Y N N
_ TYPE = 'SES_TABLE'; ¦ Y N
_ ------------------------------------------------------------+--------
_ RETURN('Y'); ¦ 1 1 1
_ RETURN( ¦ 1
_ 'Your user group can only define TEM and SES tables'); ¦
---------------------------------------------------------------------------

 

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