0% found this document useful (0 votes)
106 views5 pages

Custom Extension Implementation Guide

The document outlines the process of building a custom extension in Teamcenter, which allows users to add specific behaviors to business object operations. It provides a use case example involving the copying of attributes from a DesignItemRevision to a DocumentRevision through a specified relation, detailing the steps for creating, attaching, and coding the extension. Key considerations include identifying primary and secondary business objects, the operation for the extension, and the appropriate action point for execution.

Uploaded by

A rubangura
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views5 pages

Custom Extension Implementation Guide

The document outlines the process of building a custom extension in Teamcenter, which allows users to add specific behaviors to business object operations. It provides a use case example involving the copying of attributes from a DesignItemRevision to a DocumentRevision through a specified relation, detailing the steps for creating, attaching, and coding the extension. Key considerations include identifying primary and secondary business objects, the operation for the extension, and the appropriate action point for execution.

Uploaded by

A rubangura
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

7/11/23, 11:04 AM Building Custom Extension with Example

admin Jul 9, 2022 3 min read

Building Custom Extension with Example


An extension is a business rule that adds pre-defined behavior to a business object operation and fires as a pre-
condition, pre-action, or post-action. When we define an extension, we can identify the parameters passed to the
extension when it is executed, and how the extension is made available to other business objects.

For Example, we can use the same custom extension to more than on business object operation and differentiate
the functionality or behavior based on the parameter value.

Extensions allows to write a custom function or method for Teamcenter in C or C++ and attach the rules to
predefined hook points in Teamcenter.

After we assign an extension to a business object or a property operation so that it is called at a particular point
(on a pre-condition, pre-action, base action, or post-action on the object), we must write the implementation code
that takes place in Teamcenter when the extension is called.

Use Case Example:

Let us take an use case to understand how the extension works.

In this use case, we have 2 objects - DesignItemRevision and DocumentRevision. They are related using
IMAN_specification (Specification) relation. The ask is to copy attributes from DesignItemRevision to
DocumentRevision whenever they are related using Specification relation.

Key things to identify,

1. What is the primary business object

2. What is the relation business object

3. What is the secondary business object


[Link] 1/5
7/11/23, 11:04 AM Building Custom Extension with Example

4. Action on which extension has to be execution

5. Business object operation that suits the extension for the use case

6. Operation point (Pre-Condition/Pre/Post Action) for the extension based on the use case.

For our use case:

1. What is the primary business object - Design Item Revision

2. What is the relation business object - IMAN_specification

3. What is the secondary business object - Document Revision

4. Action on which extension has to be execution - During relation creation

5. Business object operation that suits the extension for the use case - GRM_create

6. Operation point (Pre-Condition/Pre/Post Action) for the extension based on the use case. - Post Action.
Relation has to be successfully created in our use case. we should not copy attributes during relation
failures.

Implementation of the use case:

1. Create custom extension in BMIDE:


- Create a new extension in BMIDE.
- In Extension tab, traverse through Project -> Rules -> Extensions
- Right click on Extensions folder -> New Extension Definition.
- In New Extension Definition dialog, type in the Name of the new custom extension and select the Library.
Extension will be added to the selected library.
- For the simplicity of this usecase, parameters are not defined. Parameters comes in handy to make the
extensions scalable to various scenarios/use cases to work differently based on parameter value.

- Add Availability based on our findings for this use case (from previous section).
Business object name - IMAN_specification

[Link] 2/5
7/11/23, 11:04 AM Building Custom Extension with Example

Type - Type
Operation name - GRM_create
Extension point - PostAction

2. Add extension to operations in BMIDE:


- After creating the custom extension, next step is to attach the extension to the business object under
operations as defined in availability.
- For our use case, extension has to be attached in specification object in grm_create operation at
postaction.

- Select GRM_create operation and under Extension Attachments click Add to add our custom extension in
post-action.
- Save the datamodel and deploy the BMIDE package through tem.

[Link] 3/5
7/11/23, 11:04 AM Building Custom Extension with Example

3. Coding Custom Extension:


- Last step in the process to code the logic to copy the attribute values.
- In this example we use BMIDE to generate extension psuedo code.

- For coding extension we need to know the arguments (va_list) the extension passes. We can get this
information in ITK help. Search with <Operation_name>_msg.

- For GRM_create operation, 5 parameters are passed in va_list which can be read in the code and used for
the logic.
- For our use case, we need first 2 parameters. Primary and secondary object.

[Link] 4/5
7/11/23, 11:04 AM Building Custom Extension with Example

tag_t tPrimaryObject = va_arg(args, tag_t);


tag_t tSecondaryObject = va_arg(args, tag_t);

- Once we get the primary and secondary object, we can build our logic to read and set the attributes as
like any other customization. (we haven't showed the code, you can try and let us know if you need any help).
- Build and deploy the library to test the usecase.

[Link] 5/5

Common questions

Powered by AI

Challenges in deploying a custom extension to a business object operation may include ensuring compatibility with existing code, managing dependencies, and accurately defining the operation points and conditions. These challenges can be addressed by thorough testing, validating parameter inputs, and using version control systems for code management. Additionally, understanding the business object's lifecycle and environment helps in reducing integration issues .

The differentiation between primary and secondary business objects impacts the design and execution of a custom extension by determining the roles and data flow between objects during the operation. This distinction guides the logic for attribute copying, ensuring that changes are consistently attributed to the correct sources and targets. Proper identification and handling of these objects prevent errors and ensure the functional integrity of the extension .

Selecting the correct operation point for a custom extension is crucial because it determines when the extension logic will be executed during the lifecycle of a business object operation. For example, in the use case described, using a Post-Action point ensures that attributes are only copied after the successful creation of a relation, preventing unnecessary operations during relation failures. This precision in timing maximizes the efficiency and reliability of the customization .

Integrating a custom extension with the BMIDE environment begins with creating a new extension through the BMIDE interface by navigating to Rules -> Extensions and defining the extension's properties and parameters. Once created, the extension must be attached to the appropriate business object operation, specifying its availability conditions. Finally, after coding the extension's logic, the BMIDE package is deployed using tem to apply the changes within Teamcenter .

Parameterization of extensions in Teamcenter allows them to be scalable across various scenarios by enabling the same extension to behave differently based on the parameter values. By identifying the parameters passed to the extension when executed, developers can customize and differentiate functionality for different business object operations. This capability makes extensions adaptable to a wide range of uses without rewriting code for each specific case .

Coding and testing a custom extension require considerations of factors such as correct interpretation of the logic requirements, accurate selection of hook points, compatibility with existing system architecture, and error handling. It is essential to validate all possible parameter inputs and test the extension under different scenarios to gauge its performance and reliability. Thorough documentation and use of debugging tools can also enhance testing outcomes, ultimately ensuring the extension's effectiveness in a live environment .

In Teamcenter custom extensions, the primary and secondary objects are identified through the arguments passed in a va_list, as provided by ITK function documentation. For instance, during the GRM_create operation, tag_t types are used to extract these objects from the list of parameters. This procedure allows for the implementation of logic to read and set attribute values, facilitating tasks such as attribute copying between related objects .

Predefined hook points in Teamcenter serve as strategic points within business object operations where custom extensions can be integrated. These points, such as pre-condition, pre-action, and post-action, provide opportunities for executing extensions at specific stages of an operation's lifecycle, allowing for tailored behavior such as validation, data manipulation, or logging to be inserted seamlessly into existing processes .

Parameterization might fall short when an extension requires drastically different logic or when parameters alone cannot capture the complexity or variability of a new use case. In such cases, developing additional extensions or modularizing the existing logic to allow for more significant behavioral adjustments might be necessary. Advanced configurations or conditional logic could be employed to handle such complexities without over-reliance on parameter values alone .

A custom extension in Teamcenter is designed to add pre-defined behavior to a business object operation by firing during a pre-condition, pre-action, or post-action phase. Extensions allow for custom functions or methods to be written in C or C++ and attached to specific hook points in Teamcenter. These extensions enable operations such as initializing or modifying object operations based on certain parameters, providing a way to customize object behavior within the software environment .

You might also like