Availability of V5 Properties through FBDI Business Logic |
Technical Article |
AbstractThis article details the lists of CATIA V5 properties which can be read from FBDI Business Logic. The content of these lists depends on the modeler used to call the Business Logic. |
During FBDI each modeler offers the ability to modify its V6 attributes through FBDI Business Logic. In this Business Logic the modeler exposes the V5 properties of its data to import in order to valuate the V6 attributes of its generated component. This chapter details which V5 properties are available according to each modeler and how they can be used to valuate V6 attributes.
For instance (see below) Product Structure modeler exposes the V5 property named "Part Number". It is therefore possible to use the value of the Product's Part Number in the rule script to valuate the V6 attribute named "PLMExternal_ID" of the generated component. For each V6 Component Type it is possible to define a rule.
The available V5 properties are gathered in two groups, Native and User V5 Properties:
Each modeler exposes these properties following its own way as it is described below.
This modeler is used for the import of CATPart, CATProduct and Design Table source. This import generates several V6 components VPM Reference, VPM Representation Reference, etc. The Product Structure properties are defined in CATIA V5, they are gathered in two lists in CATIA V5, Native and User properties as explained before. All these Properties are editable through CATIA V5 Edit\Properties command:
These same V5 Properties can be read through Business Logic scripts.
This array shows the Native V5 Properties available in Business Logic script. This script corresponds to a CATIA V6 PLM Entity. This Entity corresponds itself to a CATIA V5 imported document. For example during the creation of a CATIA V6 VPMReference resulting from the migration of a CATProduct it is possible to access through the script to the CATIA V5 properties of the CATProduct such as PartNumber, Revision, Definition, Nomenclature, Source and DescriptionRef.
CATIA V5 Document to Import | CATIA V6 PLM Entity (this Object) | Available Parameters in the Script | Available Parameters Type | Available V5 Properties in the Script | |
---|---|---|---|---|---|
Name | Type | ||||
CATProduct | VPMReference | NativeV5Properties | feature | PartNumber | String |
Revision | String | ||||
Definition | String | ||||
Nomenclature | String | ||||
Source | String | ||||
DescriptionRef | String | ||||
UserV5Properties | feature | Any | Any | ||
VPMInstance | None | None | None | None | |
CATPart | VPMReference | NativeV5Properties | feature | PartNumber | String |
Revision | String | ||||
Definition | String | ||||
Nomenclature | String | ||||
Source | String | ||||
DescriptionRef | String | ||||
UserV5Properties | feature | Any | Any | ||
VPMRepReference | NativeV5Properties | feature | PartNumber | String | |
Revision | String | ||||
Definition | String | ||||
Nomenclature | String | ||||
Source | String | ||||
DescriptionRef | String | ||||
UserV5Properties | feature | Any | Any | ||
VPMRepInstance | None | None | None | None | |
Design Table source | VPMRepReference | NativeV5Propertie | feature | PartNumber | String |
In the script interpreted during Import of VPMReference it is then possible to read PartNumber, Revision, Definition, Nomenclature, Source and DescriptionRef properties. In the following script "Parameters" allows you to retrieve the available V5 parameters (NativeV5Properties and UserV5Properties features) whereas "ThisObject" represents the V6 PLM Entity.
Let NativeV5PropFeat(feature) Let PartNumber_val(string) PartNumber_val= "" Let Revision_val(string) Revision_val= "" if (Parameters->HasAttribute("NativeV5Properties") == true) { Set NativeV5PropFeat = Parameters->GetAttributeObject("NativeV5Properties") if (NativeV5PropFeat->HasAttribute("PartNumber") == true) { PartNumber_val= NativeV5PropFeat->GetAttributeString("PartNumber") ThisObject->SetAttributeString("PLM_ExternalID" , PartNumber_val + "_Company_X") } if (NativeV5PropFeat->HasAttribute("Revision") == true) { Revision_val= NativeV5PropFeat->GetAttributeString("Revision") ThisObject->SetAttributeString("V_description" , Revision_val + "_Company_X") } }
This array shows the availability of User Properties in the script. For "User V5 Properties" the type and the name can not be known a-priori as they are defined by user in CATIA V5 document. This array shows nevertheless on which script corresponding to a CATIA V6 PLM Entity it is possible to read these properties.
CATIA V5 Document to Import | CATIA V6 PLM Entity (This Object) | Available Parameters in the Script | Available Parameters Type | Available V5 Properties in the Script | |
---|---|---|---|---|---|
Name | Type | ||||
CATProduct | VPMReference | UserV5Properties | feature | Any | Any |
VPMInstance | None | None | None | None | |
CATPart | VPMReference | UserV5Properties | feature | Any | Any |
VPMRepReference | UserV5Properties | feature | Any | Any | |
VPMRepInstance | None | None | None | None |
In the example shown previously we have seen that user has defined in CATIA V5 for his Root Product Reference three User Properties.
In the script read for VPMReference it will be then possible to access to these properties:
Let UserV5PropFeat(feature) Let RevisionNumber(string) RevisionNumber_val= "" Let OEM(string) OEM_val= "" if (Parameters->HasAttribute("UserV5Properties") == true) { Set UserV5PropFeat= Parameters->GetAttributeObject("UserV5Properties") if (UserV5PropFeat->HasAttribute("RevisionNumber") == true) RevisionNumber_val = UserV5PropFeat->GetAttributeString("RevisionNumber") if (UserV5PropFeat->HasAttribute("OEM") == true) OEM_val = UserV5PropFeat->GetAttributeString("OEM") ThisObject->SetAttributeString("V_description" , RevisionNumber_val + OEM_val) }
In the two previous paragraphs we have learnt how to access V5 properties. In this one we will use these properties to valuate CATIA V6 attributes of specific CATIA V6 Entities through rules. To execute rules during the import they should be declared and implemented in a CATRuleExit file and a CATRule file respectively. These files are written in EKL (Engineering Knowledge Language). To be interpreted they should be placed in CLIENT Runtimeview/resources/knowledge/script/.
For instance to use the script MyRefFBDIScript for the Entity MyRefCustoType we have implemented the following CATRuleExit, known as family.
<Scripts> <Script OpeningID="PLMImportExportAttributesValuation" Type="VPMReference" ScriptName="MyRefFBDIScript"> <Condition Attribute="OperationId" Value="FBDIImport" /> </Script> </Scripts>
This family references the script that contains the business logic implementation, which looks like the following CATRule file:
Sample 1 (MyRefFBDIScript.CATRule):
The script first gets the two available parameters for FBDI, NativeV5PropFeat and UserV5PropFeat. Then it retrieves the CATIA V5 properties PartNumber and DescriptionRef from CATIA V5 Reference. Through SetAttributeString method this script valuates the PLM_ExternalID and V_description with PartNumber and DescriptionRef respectively. If Designer User Property has been defined in migrated document the script concatenates the value of V_description with the value of Designer User V5 property.
Let NativeV5PropFeat(feature) Let UserV5PropFeat(feature) Let AttrValue(String) AttrValue = "" if (Parameters->HasAttribute("NativeV5Properties") == true) { Set NativeV5PropFeat = Parameters->GetAttributeObject("NativeV5Properties") if (NativeV5PropFeat->HasAttribute("PartNumber") == true) AttrValue = NativeV5PropFeat->GetAttributeString("PartNumber") ThisObject->SetAttributeString("PLM_ExternalID", AttrValue) if (NativeV5PropFeat->HasAttribute("DescriptionRef") == true) AttrValue = NativeV5PropFeat->GetAttributeString("DescriptionRef") if (Parameters->HasAttribute("UserV5Properties") == true) { Set UserV5PropFeat = Parameters->GetAttributeObject("UserV5Properties") AttrValue = AttrValue + "_designed_by_" if (UserV5PropFeat->HasAttribute("Designer") == true) AttrValue = AttrValue + UserV5PropFeat->GetAttributeString("Designer") else AttrValue = AttrValue + "Designer Property not defined" } ThisObject->SetAttributeString("V_description" , AttrValue ) }
If no Business Logic is provided some attributes are valuated by default:
CATIA V5 | CATIA V6 | ||||
---|---|---|---|---|---|
CATIA V5 Entity | Property name | Type | CATIAV6 Entity | Attribute name | Type |
Product reference | _PartNumber | String | VPMReference | PLM_ExternalID (*) | String |
_DescriptionRef | String | V_description (**) | String | ||
Product instance | _InstanceName | String | VPMInstance | PLM_ExternalID | String |
_DescriptionInst | String | V_description | String | ||
Part | _PartNumber | String | VPMReference | PLM_ExternalID (*) | String |
_DescriptionRef | String | V_description (**) | String | ||
_PartNumber | String | VPMRepReference | PLM_ExternalID (*) | String | |
Representation name | String | VPMRepInstance | N/A | String | |
Design Table source | _PartNumber | String | VPMRepReference | PLM_ExternalID | String |
(*) The PLM_ExternalID of the Reference and Representation Reference is valuated by the concatenation of the value of the Part Number (for example: “Part1”) and the value coming from the User Exit of Creation (for example: “MyIDStringProduct001”) separated with “_”. Example: “Part1_MyIDStringProduct001”. (**) If the attribute V_description is already valuated (by the user exit of Creation), the value of the V5 Description will overwrite it. The PLM_ExternalID of Representation Instance is always “Shape1” (no customization possible through the User Exit today). The PLM_ExternalID of Instance is the value coming from the Instance name (no customization possible through the User Exit today).
This modeler is used for non-CATIA documents at the condition they are not considered as a Design Table Source (The Design Table Source are migrated with the Product Structure modeler.) The import of non-CATIA document generates one kind of V6 Component, Content Management Representation Reference.
This array shows the mapping between V5 and V6 data as well as the availability of V5 property in Business Logic script. This script is interpreted during the import Non-CATIA document into Representation Reference. In this script it is possible to access to the CATIA V5 property, FilePathname to valuate the attributes of Representation Reference.
CATIA V5 Document to Import | CATIA V6 PLM Entity (This Object) | Available Parameters in the Script | Available Parameters Type | Available V5 Properties in the Script | |
---|---|---|---|---|---|
Name | Type | ||||
Non-CATIA document | Content Management Representation Reference | NativeV5Properties | feature | FilePathname | String |
For this modeler the User V5 Properties are not available.
To execute rules during the import they should be declared and implemented respectively in a CATRuleExit file and an CATRule file. These files are written in EKL (Engineering Knowledge Language), to be interpreted they should be placed in <<CLIENT Runtimeview>>/resources/knowledge/script/.
A CATRuleExit file is used to declare which script is used for a specific CATIA V6 Entity, whereas CATRule file implements the used script.
For instance to use the script MyRefFBDIScript for the Entity PLMDMT_DocCustom we have implemented the following CATRuleExit, known as family.
<Scripts> <Script OpeningID="PLMImportExportAttributesValuation" Type="PLMDMT_DocCustom" ScriptName="MyRefFBDIScript"> <Condition Attribute="OperationId" Value="FBDIImport" /> </Script> </Scripts>
This family references the script that contains the business logic implementation, which looks like the following CATRule file:
Sample 1 (MyRefFBDIScript.CATRule):
The script modifies PLM_ExternalID in the case of a first import and only modifies V_description in case of Update.
Let NativeV5PropFeat(feature) Let FilePathname="" Let AttrSize=0 Let IsFirstImport (Boolean) Let Name(String) IsFirstImport = true Name = "" if (Parameters->HasAttribute("FirstImport") == true) { IsFirstImport = Parameters->GetAttributeBoolean("FirstImport") if ( IsFirstImport == true ) /* Identifier Set attributes are modified*/ { if (Parameters->HasAttribute("NativeV5Properties") == true) { Set NativeV5PropFeat = Parameters->GetAttributeObject("NativeV5Properties") if (NativeV5PropFeat->HasAttribute("FilePathname") == true) { FilePathname = NativeV5PropFeat->GetAttributeString("FilePathname") AttrSize=FilePathname.Length() FilePathname = FilePathname.Extract(AttrSize-19,15) ThisObject->SetAttributeString("PLM_ExternalID" , FilePathname + ToString(Parameters->GetAttributeInteger("IncSessionId")) + "_FirstImportValuated" ) } } } else /* Identifier Set attributes are not modified*/ { ThisObject.V_description = "_SecondImportValuated" } }
If no Business Logic is provided some attributes are valuated by default:
CATIA V5 | CATIA V6 | |||||
---|---|---|---|---|---|---|
Property Name | Type | Attribute Name | Type | Example with FilePathname: E:\Data\XLSFile.xls | ||
Non-CATIA document excepting Design Table Source | FilePathname | String | Content Management Representation Reference | PLM_ExternalID: Concatenation of: Name (without the extension) + "_" + Identification String + "Representation" + Session Increment | String | XLSFile_IdString_Representation1 |
FilePathname | String | V_Name: File name | String | XLSFile.xls | ||
FilePathname | String | V_DocumentName: Name (without the extension) | String | XLSFile | ||
FilePathname | String | V_PrimaryFileName: FilePathname | String | E:\Data\XLSFile.xls | ||
Filetype | String | V_PrimaryMimetype: Filetype | String | xls |
Version: 1 [January 2008] | Document created |