Skip to content

Add Custom TCComponent like java classes

June 17, 2012

Summary:

The com.teamcenter.rac.kernel.TCComponent (and classes derived from TCComponent ) represents Teamcenter data model business objects ( or classes) in Rich Client.

Pre-requisite:

  1. Create a Teamcenter plugin project.
  2. You need to have custom data model business objects, that you plan to map to TCComponent classes.

Overview:

  1. Create custom data model business objects (or classes).
  2. Create JAVA classes for TC data model business object (or class).
  3. Associate JAVA class to data model business object (or class) using teamcenter extension.

Details:

1. Create custom teamcenter data model business objects (or classes) :

The Teamcenter data model can be customized using TC BMIDE tool.  – How to use BMIDE? – How to create custom data model business objects (or classes)? will be covered as part of a dedicated post.

2.  Create a JAVA class for TC data model business object (or class) :     The data model business object (or class) that we are trying to map here is MyItem. The business object MyItem is descendent of Teamcenter business object Item.

  • Create a JAVA class, name it “ABC9ComponentMyItem.java”.
  • Extend class “ABC9ComponentMyItem” from “TCComponentItem” class.
  • Create one more JAVA class, name it “ABC9ComponentMyItemType.java”.
  • Extend class “ABC9ComponentMyItemType” from “TCComponentItemType” class.
  • If any behaviour needs customization, the same can be provided by Implementing/Overriding required methods in ABC9ComponentMyItem(Type) class.

NOTE : Teamcenter recommends that all the customizations should use a prefix format for all customized entities. The recommended format for prefix…           <Three Alphabetical Characters><One Digit Between 4-9>.

3.  Associate JAVA class to data model business object (or class) using teamcenter extension Your TCComponent look alike class for custom business object is ready. But teamcenter does not know about your component class. You need to associate your java class to business object using teamcenter extension.

  1. Go to plugin.xml file for your plugin project.
  2. Open the plugin.xml in plugin editor in Eclipse.
  3. Go to Extensions section.
  4. Add an extension com.teamcenter.rac.kernel.Kernel_Components to the plugin.xml file.
  5. The extension needs info as shown below…

<extension id=“com.teamcenter.rac.kernel”

               point=“com.teamcenter.rac.kernel.Kernel_Components”>

      <entry id = “MyItem”

              name=“com.mycompany.rac.kernel.ABC9ComponentMyItem”

              type=“com.mycompany.rac.kernel.ABC9ComponentMyItemType”

              icct=“com.teamcenter.tc.kernel.icctstubs.ICCTItem”  />

</extension>

Save plugin.xml file. compile and build your plugin. Deploy the plugin to Teamcenter.

Benefits:

  • ABC9ComponentMyItem is recognized by the Teamcenter framework. The custom class would become integral part of TC RAC framework.
  • TC would create an object of ABC9ComponentMyItem (and not TCComponentItem) whenever an object of MyItem type is needed in RAC.
  • The source code would be better organized if all the RAC/UI customization related to MyItem object remains within ABC9ComponentMyItem(Type) class.
  • The source would be maintainable and readable.
  • Developers can clearly distinguish between Item (TCComponentItem) and MyItem (ABC9ComponentMyItem) objects in RAC code.
  • Many more benefits…

Congratulations, you have sucessfully added a component class to Rich Client framework. I hope this post helps.

5 Comments
  1. Jamel permalink

    Good article, thank you.

    I have a question regarding “Add Custom TCComponent like java classes”, is it possible to add a plain java object not depending on TCComponent ?

    • Can you please provide more details about the scenario that you are looking for?

  2. Hi Jamel,

    I checked the Kernel_Components extension point and found that the class mentioned for “name” attribute should be (direct or indirect) sub class of TCComponent. Also the class name mentioned for “type” should be (direct or indirect) sub class of TCComponentType.

    Hope it helps.

    PLM.

  3. Sri permalink

    Hi

    I am new to the PLM area i read the Term Business Objects in Team center.
    How different is it from SAP Business Objects.
    Is it a Component in Team center or separate reporting tool?

    Regards,
    Sri

    • I am sorry I have never worked with SAP. However in Teamcenter the Business Object can be thought of Component Type.
      One can create instances of Business Object Type (or Component type).

      I hope this answers your question.

Leave a comment