PLM Business Logic to Support Data Upgrade: Unified Typing Migration Type and Attributes Mapping (INFRA_UnifiedTypingMigration)

An opening ID is an entry point used to customize business logic. The Unified Typing Migration and Attributes Mapping (INFRA_UnifiedTypingMigration) opening lets you declare mapping between the former typing types and attributes on the one hand, and unified typing types, extensions, and attributes on the other hand.

Note: You are concerned only if you migrated your data from the former typing to the unified one.
Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked when upgrading the PVS (persistent filters) and the persistent queries from the former typing to the unified typing. To support the data migration, you must have described your mapping in mapping files on the server. These files could not be accessed form the client to upgrade PVS in the past. This opening lets you describe your mapping in another format.

This opening is used to:

  • Precise a unified typing specialization type, if the migration consisted in migrating all objects of the customized type (former typing) to objects of this specialization type. This is done using the ComputedTargetTypeName parameter. You can leave this parameter empty if all objects have been migrated with the DefaultTargetTypeName.
  • For each attribute (in PreviousAttributes list), define where it is located after the data migration.
    Note: An attribute:
    • may be lost in the migration.
    • may be located under the specialization type, potentially with another name.
    • may be located in an extension, potentially with another name.

In output of the business rules, two lists, MappedAttributes and MappedExtensions, must be filled.

The table below provides you with information related to the definition of the Opening ID.

PLM Opening ID: INFRA_UnifiedTypingMigration
Customization intent: Computation
Execution context: Client

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read/Write Comments
DefaultTargetTypeName String Read Name of the default target type used to perform the query or the filter, instead of using the customized former typing type that was previously defined in the persistent query.

For example, if the query was done on a customization of VPMReference, it is now VPMReference.

PreviousAttributes List Read List of the customized attribute names that were used in the PVS.
ComputedTargetTypeName String Write Parameter used to precise a unified typing specialization type, if the migration consisted in migrating all objects of the customized type (former typing) to objects of this specialization type.
Note: You can leave this parameter empty if all objects have been migrated using the DefaultTargetTypeName parameter.
MappedAttributes List of strings Write Output list whose size should be identical to the PreviousAttributes parameter size. It should contain the new names of the attributes. If an attribute is lost, enter an empty name.
MappedExtensions List of strings Write Output list whose size should be identical to the the PreviousAttributes parameter size. It should contain the name of the extension type where the attribute has been migrated. If the attribute is not defined on an extension, but on the specialized type, enter an empty name.

Sample

The following sample shows how to use this opening.

Let’s imagine that in the former typing customization, the customized type is PLMProductDS. This type has three string attributes (V_StdNumber, V_IndustryCode, V_BOM). In the unified typing customization, objects of such a type have been migrated to a specialized type SpecializedProductReference. This type has an attribute V_StdNumber2, extended by an extension DeplExtForIndustryCode2. This extension has the V_ IndustryCode2 attribute.

The business rule below describes that StdNumber is mapped to V_StdNumber2 and V_IndustryCode to V_IndustryCode2, and that V_BOM is forgotten in the process.

/* Be sure that VPM Reference is set */
let x="" 
let listeInput(List) 
let listeOutput(List) 
let listeExtensionsOutput(List) 
let nameAttribute=""

x = Parameters->GetAttributeString("DefaultTargetTypeName")
if (x=="VPMReference")
{
  /* you get the input list */
  set listeInput =  Parameters->GetAttributeObject("PreviousAttributes")

  for nameAttribute inside listeInput
  {
	if (nameAttribute=="V_StdNumber")
	{
	   listeOutput->Append("V_StdNumber2")
	   listeExtensionsOutput->Append("")
	}
	else if (nameAttribute=="V_IndustryCode")
	{
	   listeOutput->Append("V_IndustryCode2")
	   listeExtensionsOutput->Append("DeplExtForIndustryCode2")
	}
	else if (nameAttribute=="V_BOM")
	{
	   listeOutput->Append("")
	   listeExtensionsOutput->Append("")
	}
  }

  /* The outputs are valuated*/
  Parameters->SetAttributeString("ComputedTargetTypeName","SpecializedProductReference")
  Parameters->SetAttributeObject("MappedAttributes",listeOutput)
  Parameters->SetAttributeObject("MappedExtensions",listeExtensionsOutput)
}