Upgrading Former Customization Performed Using MQL/Business Tools

This topic explains how to make existing data customization performed using MQL/Business tools compatible with the unified typing mode. You may have performed a customization using MQL and/or business rules. Typically you may have added some sub types to DS types, using the following mql commands:

add type MyDoc derived Document;
add  attribute myAtt1 type string;
mod type MyDoc add attribute myAtt1;

This approach used to work and still does as far as the objects created using the new types are not sent to the native client (for example CATIA). These objects can be sent to the native client when some links have been established between objects.

Typically between a Physical Product ( i.e a kind of ‘VPMReference’) and a document (for example a MyDoc object). In that case, the rich client cannot fully open the pointing object. To avoid this, you must use Data Model Customization. This tool is a web console allowing the administrator to create new subtype and attributes for existing DS types.

If the customization occurred before the availability of Data Model Customization (V6R2013x), you must manually modify the admin objects using MQL to make them compatible with the new approach.

Example

The sample script below shows how to create a subtype (MyPartDemo) of Part with one attribute. It will be visible in the native apps and editable in Data Model Customization (after switching that package to ReadWrite mode).

#Create a package with a link to its father (EBOM here)
add package EBOMPackDemo property Specialization value Yes uses package EBOM custom true !hidden;

# Add a UUID to the package. It is mandatory for Data Model Customization. A UUID can be generated using uuidgen under Windows. Make sure to
use the same format as below. Make sure not to copy/paste the UUID.
mod  package EBOMPackDemo property UUID value  39a5bf85-d296-45c0-8ed0-e9590dd15d09;

# Declare a placeholder prefix.
mod  package EBOMPackDemo property IPML.CustoPrefix value "";
mod program "eServiceSchemaVariableMapping.tcl" add property package_EBOMPackDemo to package EBOMPackDemo;

# Add sub type of Part
add type MyPartDemo derived Part abstract false;
mod program "eServiceSchemaVariableMapping.tcl" add property type_MyPartDemo to type MyPartDemo;

# Add the Specializable property
mod type MyPartDemo add property Specializable value Yes;

# Add a UUID to the type. It is mandatory for TXO. A UUID can be generated using uuidgen under Windows. Make sure to use the same format as below. Make sure not to copy/paste the UUID
mod type MyPartDemo add property UUID value e3f62fbc-fefb-4447-8c85-5c06ffcc3e3b;

# Create a new global attribute
add attribute Att1PartDemo type string default "Defau1t for Att1" resetonclone  resetonrevision  property IPML.CustoUserAccess value ReadWrite;
mod program "eServiceSchemaVariableMapping.tcl" add property attribute_AttPartDemo to attribute Att1PartDemo;

# Add a UUID to the attribute. It is mandatory for TXO. A UUID can be generated using uuidgen under Windows. Make sure to use the same format as below. Make sure not to copy/paste the UUID
mod  attribute Att1PartDemo add property UUID value 8f386af4-67b3-4bcc-8ec4-0500343e32dc;

# Since R2015x : add the Indexation property set to TRUE in order to index the attribute 

# Since R2015x : add the Indexation property set to TRUE in order to index the attribute in Exalead (see note at the end)
mod attribute Att1PartDemo add property Indexation value TRUE;

# Link the attribute to the type
modify type MyPartDemo add attribute Att1PartDemo;

# Add the type in the package
modify package EBOMPackDemo add member type MyPartDemo;

Notes:
  • The package name EBOMPackDemo is free.
  • The package can contain as many types as needed. If a new subtype is created for MyPartDemo, it must be added to the package.
  • You should also create symbolic names (lines starting with mod program) to ensure a proper integration in the web user interface. It is not needed for native apps.
  • The attributes must hold a property named IPML.CustoUserAccess. The allowed values are ReadWrite, ReadOnly, None. It is the behavior of the attribute in the user interface. None means that the attribute is not displayed.
  • About indexation: to ensure a proper indexation, the administrator must launch the Update index for Package(s) located in Data Model Customization. This command updates the index specification (config.xml) in the database.