A user exit is used to valuate the PLM attributes of the references
and the representation references created in FBDI. The only attributes that
can be valuated are defined as 'public' (visibility) and 'user' or 'free'
(protection) in the modelers' customization.
The attributes are also projected
in the knowledge dictionary. These attributes can be evaluated from the V5
properties and the file name and type transmitted as parameters to the user
exit.
FBDI uses the import business logic. If this business logic does
not exist, it uses a default mapping between V5 properties and 3DEXPERIENCE attributes
as described below.
Examples:
Opening Purpose:
A customized valuation of the PLM components' attributes. This valuation is provided for references
and representation references created in the FBDI process.
PLM Opening ID:
The PLM attributes pre-valuation user exit opening
ID is PLMImportExportAttributesValuation. The operation ID is FBDIImport.
Opening Type:
This is an execution opening that enables the valuation
of the PLM components' attributes.
Script Inputs:
ThisObject (Fact):
Knowledge volatile
instance holding the PLM type and attributes (that are projected into the
knowledge dictionary) of the PLM component.
Parameters (Context):
String IdString
Used to
pre-evaluate the identifier attribute. It can be interpreted as a prefix for
instance (not mandatory for the business logic).
Integer> IncSessionId
Has the unique increment key in session.
String FileName
Name of the imported
file.
String FileType
File extension.
'NativeV5Properties' List of Properties
List of the V5 properties for a given 3DEXPERIENCE PLM type
(i.e. VPMReference or VPMRepReference in the product modeler). Each modeler exposes
a given list of attributes that are transmitted to the script of the
business logic. This list of parameters is fixed. But, one or several parameters may not
be evaluated.
For a VPMRepresentation reference that has been created
in FBDI without the corresponding V5 reference product, the V5 properties are
not valuated. DMU representation
reference and rendering representation reference are some common types of VPMRepresentation references.
'UserV5Properties' List of User Properties
The list of V5 user properties. This list is specific
to a V5 object. It is enriched at run time depending on the user properties
defined on the object.
Validation
Not applicable in an execution
rule.
Script Outputs:
ThisObject (Fact)
The PLM attributes'
valuation.
Default Mapping
A default behavior is used for mapping when no script is defined
for a given customization. This behavior is based on the business logic of initialization
to evaluate the parameters in accordance with the selected environment.
Depending on the modeler, some parameters are overloaded with
the values of the V5 properties.
The attributes' mapping is defined when no script is found for a given customization
of the product structure modeler. The mapping is also defined when attributes of PLM components created in FBDI are valuated using the user exit of
the current environment.
Mapping of PLM core attributes
/ reference or instance properties is shown in the following table:
V5 | 3DEXPERIENCE |
---|
Product Reference | Property Name | Type | | Attribute Name | Type |
_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 | | VPMReference | PLM_ExternalId (*) | String |
_DescriptionRef | String | V_description (**) | String |
Representation
name | String | VPMRepInstance | N/A | String |
The attributes have a pre-defined maximum length.
If necessary, the property values are truncated to respect this
maximum length.
The PLM_ExternalID of the reference
and representation reference is evaluated by linking
the value of the part number (for example: "Part1") and the
value coming from the user exit of creation (for example: "MyIDStringProduct001")
separated with "_". For example: "Part1_MyIDStringProduct001".
If the attribute V_description is
already valuated (by the user exit of creation), the value of
the V5 description overwrites it.
The PLM_ExternalID of representation instance
is always "Shape1" (no customization is possible through the user
exit).
The PLM_ExternalID of instance is the value
coming from the instance name (no customization is possible through
the user exit).
The V_Description of instances is the value
coming from descriptionInst (no customization is possible through
the user exit).
For the other PLM components (port and
connection), the PLM_ExternalID attribute is valuated with
name of the publication or name of the corresponding V5
element.
Customized Mapping
The administrator who creates a new customization
should create a new script file (CATRule) corresponding to the identification
initialization in FBDI.
The user exit is the only step to evaluate
the PLM attributes. The administrator should check the result's consistency
with the customization rules. So, it is recommended to define this user
exit.
There are restrictions regarding the type of the PLM component handled by the user exit. It
can be derived only from reference or RepReference (i.e. only the reference and
representation references can be evaluated with the user exit). The other types
of components (instance, RepInstance, port and connexion) are not handled by the
user exit and their naming cannot be customized through this business logic.
Example of Script
The script is based on the engineering knowledge
language presented in a specific document.
The administrator must create a .CATRuleExit file (it can be named arbitrary, and
split into multiple files) which governs the script for the opening. This
creation depends on the PLM component customization.
A CATRuleExit file is
created to declare the script to be used for a specific 3DEXPERIENCE entity. For
instance, to use the MyRefFBDIScript script for the MyRefCustoType entity, we have
implemented the following CATRuleExit, known as 'family':
<Scripts>
<Script OpeningID="PLMImportExportAttributesValuation"
Type="MyRefCustoType"
ScriptName="MyRefFBDIScript">
<Condition Attribute="OperationId" Value="FBDIImport" />
</Scripts>
This family references the script containing the business logic implementation,
which resembles the following CATRule:
Sample 1
(MyRefFBDIScript.CATRule) : First, the script contains the two
available parameters for FBDI: NativeV5PropFeat and UserV5PropFeat . Then, it
retrieves the V5 Properties PartNumber and DescriptionRef from the V5 reference.
Through the SetAttributeString method, this script valuates the PLM_ExternalID
and V_description with respectively the PartNumber and the DescriptionRef. It
also computes the value of V_description with the value of designer user V5
property.
Let NativeV5PropFeat(feature)
Let UserV5PropFeat(feature)
Let PLM_ExternalIDValue(string)
PLM_ExternalIDValue= ""
Let V_descriptionValue(string)
V_descriptionValue= ""
if (Parameters -> HasAttribute("NativeV5Properties") == true)
{
Set NativeV5PropFeat = Parameters -> GetAttributeObject("NativeV5Properties")
if (NativeV5PropFeat -> HasAttribute("PartNumber") == true)
{
PLM_ExternalIDValue = NativeV5PropFeat -> GetAttributeString("PartNumber")
ThisObject -> SetAttributeString("PLM_ExternalID", PLM_ExternalIDValue)
if (NativeV5PropFeat -> HasAttribute("DescriptionRef") == true)
{
V_descriptionValue = NativeV5PropFeat -> GetAttributeString("DescriptionRef")
if (Parameters -> HasAttribute("UserV5Properties") == true)
{
Set UserV5PropFeat = Parameters -> GetAttributeObject("UserV5Properties")
if (UserV5PropFeat -> HasAttribute("Designer") == true)
V_descriptionValue = "_designed_by_" + UserV5PropFeat -> GetAttributeString("Designer")
}
ThisObject -> SetAttributeString("V_description" , V_descriptionValue)
}
ThisObject -> SetAttributeString ("oEnterpriseItempNumber" , "PLM ExternalIDValue)
}
}
Note:
If the value of the defined attribute is too long, you may get an error
message during the Save operation.