Cancel
Showing results for 
Search instead for 
Did you mean: 

Removing a template database from the data model

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

Hi guys,

 

I've been playing with BMIDE within my test environment.

I had problems with my first project so I deleted it and created a new one.

I've made changes to my second project and wanted to update the template using TEM, but I still see the first project's template and because of it, NEXT button is not active.

How can I remove the template with the exclamation mark as below?

Right now, I can not do any update. Thanks!

 

Cem

2015-06-30_18-48-46.jpg

4 REPLIES

Re: Removing a template database from the data model

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi Cem,

 

Removing a template isn't easy but its not impossible since you own it (and the source code). I'm assuming that you've already removed data that was created with this template (if any) and that there are no dependencies templates that need to be removed first. Also, that you don't have any pending data model changes that have to be deployed (to sync model dir and db) first before the template can be deleted.

 

Warning! You will not be able to remove a template unless all the data that was created with it is deleted first. No references!

 

Basically:

  • Remove any data model definitions in BMIDE (empty the template). All except the master.xml and dependency.xml in the extension files should have no content between the tags Add, Change and Delete.
  • Repeat the same for <project>/extensions/lang.
  • Package the template and deploy to delete any data model definitions associated with this template in the db.

Now we have to manually delete/edit Teamcenter files:

  • Delete TC_ROOT\install\<template>
  • Edit/Remove from TC_ROOT\install\configuration.xml
  • Edit/Remove from TC_ROOT\install\uninstall.xml (note the txt file name)
  • Delete TC_ROOT\install\ziplist\<noted txt file name>.txt
  • Delete TC_ROOT\install\install\modules\feature_<template>.xml
  • Delete TC_ROOT\install\install\lang\en_US\<template>Bundle_en_US.xml (same for other lang as needed)
  • Edit/Remove from TC_DATA\model\FileVersions.txt
  • Edit/Remove from TC_DATA\model\master.xml
  • Delete from TC_DATA\model\<template>_dependency.xml
  • Delete TC_DATA\model\<template>_template.xml
  • Delete TC_DATA\model\lang\en_US\<template>Bundle_en_US.xml (and others as needed)
  • Run manage_model_files -upg -option=upload (pointing to TC_DATA\model)

You've cleaned up the DB and Teamcenter dirs, next you have to clean up the DS's in Teamcenter.

  • Launch Rich Client (as infodba)
  • Find folder Fnd0BMIDEResource
  • Delete <template>_template.xml, <template>_dependency.xml, <template>_template_en_US.xml (and other as needed)
  • Exit Rich Client

Finally, we've cleaned up everything and can remove the template:

  • Edit/Remove from TC_DATA/install/models.xml to remove <template> entries.
  • Run bmide_manage_templates -upg -option=remove -template=<template_name>

Note: these steps were captured from the BMIDE best practices guide (section 20.3) with a few additions from me discovered during a template renaming effort.

 

As you can see, removing a template is not easy and many things can go wrong.

 

With all that said, the easiest way is to rollback to before the template was added, since you've been maintaining backups as an extraordinary admin/developer. Or to abandon the environment and reclone from production to start over.

 

Best,

/Randy

 

 

 

 


Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4

Re: Removing a template database from the data model

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

Download this Business_Modeler_IDE_Best_Practices_Guide_V2.16.pdf document and refer section 20 .How to remove a template

 

https://support.industrysoftware.automation.siemens.com/docs/teamcenter/Business_Modeler_IDE_Best_Pr...

Re: Removing a template database from the data model

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Randy,

 

Good post and good list of TEMPLATE REMOVAL steps.  Customer wants to remove an "IG4" template.  Customer admits that template deploy may have been aborted at one time, and there is some corruption.

 

  • As a result, "bmide_remove_template" and "manage_bmide_templates" both report that the template "is not installed in the database". 
  • The template is not listed in the generated "installed_templates_info.txt". 
  • BUT.... there are tables in Oracle, and trying to deploy a new, unrelated template creates DELTA.XML containing the objects that need to be removed.

  • BUT... letting TEM try to remove them results in a slew of business_model_updater_yyyy_mm_dd.log errors, e.g: 

    Delete | TcClass | IG4_SystemOwner | 226319 | The Class "IG4_SystemOwner" is referenced by one|
    or more Business Objects. This can happen if the Business Objects referring to this Class were not successfully deleted from the database, or if there still exists Business Object definitions referring to this Class in the data model.

  • We have confirmed (via SQL queries) that while the TEMPLATE TABLES do exist in Oracle, there is no data (rows) associated with them. 

 

We are thinking of trying to REDEPLOY the template to see if the database and TC_DATA will resynch back up.

Thoughts?  Anyone have this problem before where BMIDE_REMOVE_TEMPLATE fails but tables exist in database??

 

 

Re: Removing a template database from the data model

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
You can try to deploy the template to the database in an attempt to get the db and TC_DATA back in sync using:
manage_model_files -u=infodba -p=infodba -g=dba -option=upload -template=my4custom

Also, review the contents of folder Fnd0BMIDEResource (in Teamcenter) as it will contain datasets that may be helpful.

Here's what we do to ensure the DB schema and files in TC_DATA are sync'd:
Set the environment variables PASSWD and TEMP_WORKING_DIR
Copy all of the template files into the temporary directory:
set TEMP_WORKING_DIR=C:\Temp\CompareDB
set PASSWD=infodba
copy %TC_DATA%\model\*_dependency.xml %TEMP_WORKING_DIR%
copy %TC_DATA%\model\*_template.xml %TEMP_WORKING_DIR%
copy %TC_DATA%\model\lang\*_template_*.xml %TEMP_WORKING_DIR%\lang\
copy %TC_DATA%\model\master.xml %TEMP_WORKING_DIR%
Consolidate the template files:
%TC_ROOT%\bin\bmide_consolidator -dir=%TEMP_WORKING_DIR% -file=model_consolidated.xml -consolidate=all
Extract from the database:
%TC_ROOT%\bin\business_model_extractor -u=infodba -p=%PASSWD% -g=dba -outfile=model_extracted.xml -mode=all
Compare templates vs. database:
%TC_ROOT%\bin\bmide_comparator -compare=all -new=stage_model_extracted.xml -old=prod_model_consolidated.xml -delta=check_delta.xml -log=compare_model.log
%TC_ROOT%\bin\bmide_comparator -compare=all -old=model_extracted.xml -new=model_consolidated.xml -delta=check_delta.xml -log=compare_model.log
Rename the extract.xml file to model.xml and the lang\extract_lang.xml file to lang\model_lang.xml. Replace your TC_DATA\model\model.xml and \lang\model_lang.xml files with the new ones just created. Run the following in a TC cmd prompt:
%TC_ROOT%\bin\manage_model_files -u=infodba -p=%PASSWD% -g=dba -option=upload

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4