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


Chapter 7 Coding Considerations for Event, Location, and Derived Value Rules : Coding Rules to Determine Location

Coding Rules to Determine Location
Conditions that Apply
If you are using a rule to derive a value for the location of data, it:
a.
b.
c.
Search Path
The search path is determined by the current search path for the session. Because the Table Editor on the developer’s workbench has a search path of S (for system library), when you are accessing the table from the workbench you must execute the shareable tools STEBROWSE or STE to browse or edit a table using a derived rule for location.
Sample Source Rule Definition
The following example illustrates a sample definition for the Src and Sourcename fields for the NODENAME location parameter:

 
COMMAND==> TABLE DEFINITION
 
Table: @EMPLOYEES Type: TDS Unit: DOCEXMPL IDgen: N
 
Parameter Name ult Src Sourcename
---------------- -------- - ----------------
_ REGION
_ NODENAME D FIND_LOCATION

 
Sample Set of Source Rules
The following is an example of a set of rules used to return the value of a location. The rules use the table NODENAMES to determine the location. The two arguments for the first rule refer to the table name, and the two parameters of the @EMPLOYEES table, REGION and NODENAME.

 
RULE EDITOR ===> SCROLL: P
FIND_LOCATION(TABLENAME, DATAPARM, LOCPARM);
_
_ ---------------------------------------------------------------------------
_ DATAPARM = NULL; | Y N
_ ------------------------------------------------------------+--------------
_ GET NODENAMES WHERE NAME = ’MASTER’; | 1
_ RETURN(NODENAMES.DEFAULT); | 2
_ GET NODENAMES WHERE NAME = DATAPARM; | 1
_ RETURN(FIND_LOCATION2(DATAPARM)); | 2
_ ---------------------------------------------------------------------------
_ ON GETFAIL NODENAMES :
_ RETURN(DATAPARM);

 
If the value for the data parameter is not null, the following rule is used to get the value for the location.

 
RULE EDITOR ===> SCROLL: P
FIND_LOCATION2(DATAPARM);
_
_ ---------------------------------------------------------------------------
_ NODENAMES.PREFIX=HEADSTRING(P1, 3); | Y N
_ ------------------------------------------------------------+--------------
_ RETURN(NODENAMES.DEPARTMENT); | 1
_ RETURN(NODENAMES.DEFAULT); | 1
_ ---------------------------------------------------------------------------

 
Modifying the Default Remote Location for a Session
The default remote location for your current session can be modified using the tools SETREMOTELOC(remoteloc) and REMOTELOCATION:
 
Setting the Peer Server
Using the shareable tool @PEERSERVERID, you can also specify which peer server you should be using.
Sample Rule to Change the Default Location
The following rule changes the default remote location, if it is not already the value required.

 
RULE EDITOR ===> SCROLL: P
CHANGE_LOCATION(VALUE);
_
_ ---------------------------------------------------------------------------
_ VALUE = REMOTELOCATION; | Y N
_ ------------------------------------------------------------+--------------
_ CALL SETREMOTELOC(VALUE); | 1
_ CALL ENDMSG(’THE LOCATION IS ’ || VALUE); | 1 2
_ ---------------------------------------------------------------------------

 
See Also
TIBCO Object Service Broker Shareable Tools for information about the tools.

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