There may be times when you need to modify or replace an Agent Builder agent and after running the installation for the "modifed" agent, child navigator items are not displaying properly in the TEP GUI. The workaround is to create SQL DELETE statements which are run against the TEPS database and then to re-run the installation of application support for the Agent Builder agent.
So how do you know what the DELETE statements should be? Start with a saveexport from the TEPS.
Generating a saveexport:
WINDOWS: From the ITM $CANDLEHOME\CNPS directory run migrate-export.bat
The saveexport.sql is located in the ITM $CANDLEHOME\CNPS\sqllib directory.
From the ITM $CANDLEHOME/bin directory run the command ./CandleExecute cq "runscript.sh migrate-export"
The saveexport.sql file will be located in the directory $CANDLEHOME/<arch>/cq/sqllib
From there you will find all entries that have the K + the agent code. For example if the agent code is 25, you would look for all entries with K25 and k25.
Use the following rules when creating the DELETE statements making sure to take into account case (lower k, upper K):
Table Column Example
KFWWORKSPACELINK APPLICATIONTAG DELETE FROM KFWWORKSPACELINK WHERE APPLICATIONTAG='K25';
KFWWORKSPACE WSGROUPID DELETE FROM KFWWORKSPACE WHERE WSGROUPID LIKE 'zk25%';
KFWPRESENTATION OBJECTID DELETE FROM KFWPRESENTATION WHERE OBJECTID = 'k25';
DELETE FROM KFWPRESENTATION WHERE OBJECTID = 'zk25%';
KFWPRESDEF PRESENTATIONID DELETE FROM KFWPRESDEF WHERE PRESENTATIONID ='WORKSPACE~REPORT~zk25.DC_obj_status'; THERE NEEDS TO BE A DELETE STATEMENT FOR EACH ONE
KFWFOUNDODI APPL DELETE FROM KFWFOUNDODI WHERE APPL='K25';
KFWPARMA TABLENAME DELETE FROM KFWPARMA WHERE TABLENAME LIKE 'K25%';
KFWEDGE CHILD DELETE FROM KFWEDGE WHERE CHILD LIKE '%zk25';
KFWMOBJASSIGNED ID DELETE FROM KFWMOBJASSIGNED WHERE ID LIKE '%zk25%';
KFWMOBJPROP ID DELETE FROM KFWMOBJPROP WHERE ID LIKE '%zk25%';
KFWMOBJ TEMPLATE DELETE FROM KFWMOBJ WHERE TEMPLATE LIKE 'zk25%';
KFWTMPLSIT TEMPLATE DELETE FROM KFWTMPLSIT WHERE TEMPLATE LIKE 'zk03%';
KFWTMPLSTA TEMPLATE DELETE FROM KFWTMPLSTA WHERE TEMPLATE LIKE 'zk25%';
KFWTMPL NAME DELETE FROM KFWTMPL WHERE NAME LIKE 'zk25%';
KFWSEEDLEVEL FILENAME DELETE FROM KFWSEEDLEVEL WHERE FILENAME='k25%';
KFWQUERY APPL DELETE FROM KFWQUERY WHERE APPL='K25';
The order of the delete statements is very important since there are dependencies within the tables. Make sure to put your delete statements into a file using the order above where any KFWWORKSPACELINK entries would be first and KFWQUERY would be last.
Then you want to run the sql against the TEPS database. It is recommended to keep an original copy of the saveexport.sql file in case anything does not work as expected. This will allow you to restore the TEPS database. To run the sql, KfwSQLClient is very handy. KfwSQLClient ? will display help. Examples on how to use KfwSQLClient follow:
On WINDOWS is it located in the ITM $CANDLEHOME\CNPS.
set SQLLIB=PATH WHERE SQL_FILE_NAME RESIDES
KfwSQLClient /d DSN /f SQL_FILE_NAME (DSN is usually TEPS2)
On UNIX go to $CANDLEHOME/bin and run the following commands:
export SQLLIB=PATH WHERE SQL_FILE_NAME RESIDES
./KfwSQLClient /d KFW_DSN /f SQL_FILE_NAME (KFW_DSN should not be changed... it is KFW_DSN)