How to Implement the Component Family Naming Business Logic?

Technical Article

Abstract

This article details how you can implement the Component Family Naming Business Logic based on the knowledge scripting technology.

Business Logic Intent

This business logic is called when resolving Component Family items (by code, through catalog integration or within family editor.

The goal of the Business Logic is to provide new identification attributes values for generated components.

PLM Opening Definition

This section describes the objects defining the PLM opening:

General Information

PLM Opening ID ComponentsFamilyNaming
Customization Intent Computation
Execution Context Client

Input Objects

The Business Logic is invoked for any reference included into a Product structure that results from the cloning of the Product structure defining the Component Family generic model, except for the design table representation. 

PLM Component Class Types
PLMCoreReference
PLMCoreRepReference

Context Object Parameters

Parameter Names Types Read/Write Comments
IsRoot Boolean Read True if the component is the root product reference of the product structure, False otherwise.
ItemName String Read Name of the family item currently resolved. It is equal to the value of the identification column (PartNumber column or first one if no PartNumber column is present.)
ItemIndex Integer Read Index of the family item currently resolved.
GenericModel PLMEntity Read Cloned component reference.
RevisionIndex Integer Read Index of the Component Family revision. This revision index is equal to 1 at the Component Family creation, and incremented each time a new version of the Generic Model is applied.

Implementation Sample

The following Business Logic sample shows how to modify the PLM_ExternalID of the component to clone with the Component Family item name if the root of the cloned structure is considered and in the other case, how to build this PLM_ExternalID based on the cloned component PLM_ExternalID concatened with the Component Family item index.

let generic (PLMEntity)
let isroot (Boolean)
let index (Integer)
let itemname (String)

set generic = Parameters.GetAttributeObject("GenericModel")
isroot = Parameters.GetAttributeBoolean("IsRoot")
index = Parameters.GetAttributeInteger("ItemIndex")
itemname = Parameters.GetAttributeString("ItemName")

if (isroot == true)
{
	ThisObject.PLM_ExternalID = itemname
}
else
{
	ThisObject.PLM_ExternalID = generic.PLM_ExternalID + "_" + ToString(index)
} 

Recommendations

References

History

Version: 1 [July 2007] Document created
Version: 2 [July 2010] Document updated